Browse Source

Automatic mail trial

master
Milad Karbasizadeh 11 years ago
parent
commit
a0069c1798
6 changed files with 15 additions and 25 deletions
  1. +0
    -18
      Sevomin.Models/Helpers/ScheduledTasks/TestJob.cs
  2. +0
    -1
      Sevomin.Models/Helpers/SevominRegistry.cs
  3. +9
    -1
      Sevomin.Models/Sevomin.Models.csproj
  4. +3
    -0
      Sevomin.Models/packages.config
  5. +2
    -4
      Sevomin.WebFrontend/Global.asax.cs
  6. +1
    -1
      Sevomin.WebFrontend/Views/God/Index.cshtml

+ 0
- 18
Sevomin.Models/Helpers/ScheduledTasks/TestJob.cs View File

@ -1,18 +0,0 @@
using FluentScheduler;
using Sevomin.Models.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sevomin.Models.Helpers.ScheduledTasks
{
public class TestJob : ITask
{
public async void Execute()
{
System.Web.HttpContext.Current.Application["JobLastExecute"] = DateTime.UtcNow;
}
}
}

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

@ -15,7 +15,6 @@ namespace Sevomin.Models.Helpers
Schedule<NewApplication>().ToRunEvery(2).Days().At(20, 30); Schedule<NewApplication>().ToRunEvery(2).Days().At(20, 30);
Schedule<ExpiringJob>().ToRunEvery(1).Days().At(20, 40); Schedule<ExpiringJob>().ToRunEvery(1).Days().At(20, 40);
Schedule<NewJob>().ToRunEvery(1).Days().At(20, 50); Schedule<NewJob>().ToRunEvery(1).Days().At(20, 50);
Schedule<TestJob>().ToRunNow().AndEvery(1).Days().At(20, 20);
} }
} }
} }

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

@ -52,6 +52,15 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.Identity.EntityFramework.2.0.0\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll</HintPath> <HintPath>..\packages\Microsoft.AspNet.Identity.EntityFramework.2.0.0\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Owin">
<HintPath>..\packages\Microsoft.Owin.2.1.0\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Host.SystemWeb">
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.2.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
</Reference>
<Reference Include="Owin">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text"> <Reference Include="ServiceStack.Text">
<HintPath>..\packages\ServiceStack.Text.3.9.71\lib\net35\ServiceStack.Text.dll</HintPath> <HintPath>..\packages\ServiceStack.Text.3.9.71\lib\net35\ServiceStack.Text.dll</HintPath>
</Reference> </Reference>
@ -76,7 +85,6 @@
<Compile Include="Avalin.cs" /> <Compile Include="Avalin.cs" />
<Compile Include="AvalinViewModel.cs" /> <Compile Include="AvalinViewModel.cs" />
<Compile Include="ChangePasswordViewModel.cs" /> <Compile Include="ChangePasswordViewModel.cs" />
<Compile Include="Helpers\ScheduledTasks\TestJob.cs" />
<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" />


+ 3
- 0
Sevomin.Models/packages.config View File

@ -5,6 +5,9 @@
<package id="MailChimp.NET" version="1.1.0.2" targetFramework="net451" /> <package id="MailChimp.NET" version="1.1.0.2" targetFramework="net451" />
<package id="Microsoft.AspNet.Identity.Core" version="2.0.0" targetFramework="net451" /> <package id="Microsoft.AspNet.Identity.Core" version="2.0.0" targetFramework="net451" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.0.0" targetFramework="net451" /> <package id="Microsoft.AspNet.Identity.EntityFramework" version="2.0.0" targetFramework="net451" />
<package id="Microsoft.Owin" version="2.1.0" targetFramework="net451" />
<package id="Microsoft.Owin.Host.SystemWeb" version="2.1.0" targetFramework="net451" />
<package id="Owin" version="1.0" targetFramework="net451" />
<package id="ServiceStack.Text" version="3.9.71" targetFramework="net451" /> <package id="ServiceStack.Text" version="3.9.71" targetFramework="net451" />
<package id="ShortGuid" version="1.0.0" targetFramework="net451" /> <package id="ShortGuid" version="1.0.0" targetFramework="net451" />
</packages> </packages>

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

@ -17,10 +17,8 @@ namespace Sevomin.WebFrontend
{ {
AreaRegistration.RegisterAllAreas(); AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes); RouteConfig.RegisterRoutes(RouteTable.Routes);
#if !DEBUG
//TaskManager.Initialize(new SevominRegistry());
#endif
TaskManager.Initialize(new SevominRegistry());
Application["ApplicationStart"] = DateTime.Now;
} }


+ 1
- 1
Sevomin.WebFrontend/Views/God/Index.cshtml View File

@ -51,7 +51,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<p>برای تست: @(HttpContext.Current.Application["JobLastExecute"] == null ? "اجرا نشده" : HttpContext.Current.Application["JobLastExecute"].ToString())</p>
<p>برای تست: @(HttpContext.Current.Application["ApplicationStart"] == null ? "اجرا نشده" : (DateTime.Now - (DateTime)HttpContext.Current.Application["ApplicationStart"]).Minutes.ToString())</p>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-stripped table-bordered"> <table class="table table-stripped table-bordered">
<thead> <thead>


Loading…
Cancel
Save