Browse Source

minor changes

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

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

@ -0,0 +1,18 @@
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;
}
}
}

+ 4
- 3
Sevomin.Models/Helpers/SevominRegistry.cs View File

@ -12,9 +12,10 @@ namespace Sevomin.Models.Helpers
{ {
public SevominRegistry() public SevominRegistry()
{ {
Schedule<NewApplication>().ToRunEvery(2).Days().At(8, 0);
Schedule<ExpiringJob>().ToRunEvery(1).Days().At(8, 10);
Schedule<NewJob>().ToRunEvery(1).Days().At(8, 20);
Schedule<NewApplication>().ToRunEvery(2).Days().At(20, 30);
Schedule<ExpiringJob>().ToRunEvery(1).Days().At(20, 40);
Schedule<NewJob>().ToRunEvery(1).Days().At(20, 50);
Schedule<TestJob>().ToRunNow().AndEvery(1).Days().At(20, 20);
} }
} }
} }

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

@ -76,6 +76,7 @@
<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" />


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

@ -19,7 +19,7 @@ namespace Sevomin.WebFrontend
RouteConfig.RegisterRoutes(RouteTable.Routes); RouteConfig.RegisterRoutes(RouteTable.Routes);
#if !DEBUG #if !DEBUG
TaskManager.Initialize(new SevominRegistry());
//TaskManager.Initialize(new SevominRegistry());
#endif #endif
} }


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

@ -47,10 +47,11 @@
<div class="jumbotron"> <div class="jumbotron">
<h1>سلام!</h1> <h1>سلام!</h1>
<p>یک سری اطلاعات کلی درباره وب سایت سومین در این محل قابل ارائه می باشد.</p> <p>یک سری اطلاعات کلی درباره وب سایت سومین در این محل قابل ارائه می باشد.</p>
<p>تاریخ و ساعت به وقت سرور سومین: @DateTime.Now.ToShortDateString() - @DateTime.Now.ToShortTimeString()</p>
<p>تاریخ و ساعت به وقت سرور سومین: @DateTime.Now.ToShortDateString() - @DateTime.Now.ToShortTimeString()</p>
</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>
<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