Amir Ehsani 10 years ago
parent
commit
4b78b1869b
5 changed files with 31 additions and 27 deletions
  1. +0
    -20
      Sevomin.Models/Helpers/SevominRegistry.cs
  2. +0
    -1
      Sevomin.Models/Sevomin.Models.csproj
  3. +27
    -1
      Sevomin.WebFrontend.Controllers/JobController.cs
  4. +1
    -2
      Sevomin.WebFrontend/Global.asax.cs
  5. +3
    -3
      Sevomin.WebFrontend/Web.config

+ 0
- 20
Sevomin.Models/Helpers/SevominRegistry.cs View File

@ -1,20 +0,0 @@
using FluentScheduler;
using Sevomin.Models.Helpers.ScheduledTasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sevomin.Models.Helpers
{
public class SevominRegistry : Registry
{
public SevominRegistry()
{
Schedule<NewApplication>().ToRunEvery(2).Days().At(20, 30);
Schedule<ExpiringJob>().ToRunEvery(1).Days().At(20, 40);
Schedule<NewJob>().ToRunEvery(1).Days().At(20, 50);
}
}
}

+ 0
- 1
Sevomin.Models/Sevomin.Models.csproj View File

@ -88,7 +88,6 @@
<Compile Include="Helpers\ScheduledTasks\ExpiringJob.cs" /> <Compile Include="Helpers\ScheduledTasks\ExpiringJob.cs" />
<Compile Include="Helpers\ScheduledTasks\NewJob.cs" /> <Compile Include="Helpers\ScheduledTasks\NewJob.cs" />
<Compile Include="Helpers\ScheduledTasks\NewApplication.cs" /> <Compile Include="Helpers\ScheduledTasks\NewApplication.cs" />
<Compile Include="Helpers\SevominRegistry.cs" />
<Compile Include="Migrations\201409010546480_basepoint.cs" /> <Compile Include="Migrations\201409010546480_basepoint.cs" />
<Compile Include="Migrations\201409010546480_basepoint.Designer.cs"> <Compile Include="Migrations\201409010546480_basepoint.Designer.cs">
<DependentUpon>201409010546480_basepoint.cs</DependentUpon> <DependentUpon>201409010546480_basepoint.cs</DependentUpon>


+ 27
- 1
Sevomin.WebFrontend.Controllers/JobController.cs View File

@ -241,7 +241,33 @@ namespace Sevomin.WebFrontend.Controllers
return View(new DovominJobViewModel(dj)); return View(new DovominJobViewModel(dj));
} }
dj = _jobRepository.Apply(user, job, CoverLetter);
dj = _jobRepository.Apply(user, job, CoverLetter);
/* Send instant email to Avalin */
try
{
SevominEmailer emailer = new SevominEmailer();
emailer.EmailType = EmailType.NewApplication;
emailer.Parameters.Add("avalin-name", job.Avalin.DisplayName);
emailer.Parameters.Add("avalin-contact", string.IsNullOrWhiteSpace(dj.Job.ContactPersonName) ? "" : dj.Job.ContactPersonName);
emailer.Parameters.Add("dovomin-name", dj.Dovomin.DisplayName);
if (string.IsNullOrWhiteSpace(dj.Job.ContactPersonEMail))
await emailer.SendAsync(job.Avalin.Email, "اعلام آمادگی جدید برای فرصت شغلی اعلام شده در سومین", true);
else
{
await emailer.SendAsync(job.Avalin.Email, "اعلام آمادگی جدید برای فرصت شغلی اعلام شده در سومین", true);
await emailer.SendAsync(dj.Job.ContactPersonEMail, "اعلام آمادگی جدید برای فرصت شغلی اعلام شده در سومین", true);
}
}
catch (Exception e)
{
var elmah = new Elmah.Error(e);
Elmah.ErrorLog.GetDefault(System.Web.HttpContext.Current).Log(elmah);
}
/* End send instant email to avalin */
ViewBag.Result = new PostResultViewModel(true, "اعلام آمادگی شما برای این فرصت شغلی ثبت شد."); ViewBag.Result = new PostResultViewModel(true, "اعلام آمادگی شما برای این فرصت شغلی ثبت شد.");
return View(new DovominJobViewModel(dj)); return View(new DovominJobViewModel(dj));
} }


+ 1
- 2
Sevomin.WebFrontend/Global.asax.cs View File

@ -16,8 +16,7 @@ namespace Sevomin.WebFrontend
protected void Application_Start() protected void Application_Start()
{ {
AreaRegistration.RegisterAllAreas(); AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
TaskManager.Initialize(new SevominRegistry());
RouteConfig.RegisterRoutes(RouteTable.Routes);
Application["ApplicationStart"] = DateTime.Now; Application["ApplicationStart"] = DateTime.Now;
} }


+ 3
- 3
Sevomin.WebFrontend/Web.config View File

@ -34,9 +34,9 @@
</elmah> </elmah>
<system.net> <system.net>
<mailSettings> <mailSettings>
<smtp>
<network host="ml01.anaxanet.com" port="25" enableSsl="false" />
</smtp>
<smtp from="[email protected]">
<network host="localhost" port="25" enableSsl="false" userName="[email protected]" password="thIsI3aSecuR3P@$" />
</smtp>
</mailSettings> </mailSettings>
</system.net> </system.net>
<system.web> <system.web>


Loading…
Cancel
Save