Browse Source

Merge branch 'master' of bitbucket.org:miladkdz/sevomin

master
Milad Karbasizadeh 11 years ago
parent
commit
0aa8f68b78
11 changed files with 19 additions and 16 deletions
  1. +1
    -1
      Sevomin.Models/Helpers/ScheduledTasks/ExpiringJob.cs
  2. +2
    -2
      Sevomin.Models/Helpers/ScheduledTasks/NewApplication.cs
  3. +1
    -1
      Sevomin.Models/Helpers/ScheduledTasks/NewJob.cs
  4. +1
    -0
      Sevomin.Models/Helpers/SevominEmailer.cs
  5. +1
    -1
      Sevomin.Models/JobMiniViewModel.cs
  6. +2
    -2
      Sevomin.Models/JobViewModel.cs
  7. +1
    -1
      Sevomin.WebFrontend.Controllers/GodController.cs
  8. +2
    -2
      Sevomin.WebFrontend.Controllers/JobController.cs
  9. +1
    -1
      Sevomin.WebFrontend/Properties/PublishProfiles/Milad-Publish.pubxml
  10. +2
    -2
      Sevomin.WebFrontend/Sevomin.WebFrontend.csproj
  11. +5
    -3
      Sevomin.WebFrontend/Views/God/Index.cshtml

+ 1
- 1
Sevomin.Models/Helpers/ScheduledTasks/ExpiringJob.cs View File

@ -12,7 +12,7 @@ namespace Sevomin.Models.Helpers.ScheduledTasks
{ {
public async void Execute() public async void Execute()
{ {
var expiringJobs = JobRepository.Current.ListAll().Where(j => j.ExpireDate.Date == DateTime.Now.AddDays(-2).Date);
var expiringJobs = JobRepository.Current.ListAll().ToList().Where(j => j.ExpireDate.Date == DateTime.UtcNow.AddDays(-2).Date);
foreach (var job in expiringJobs) foreach (var job in expiringJobs)
{ {
SevominEmailer emailer = new SevominEmailer(); SevominEmailer emailer = new SevominEmailer();


+ 2
- 2
Sevomin.Models/Helpers/ScheduledTasks/NewApplication.cs View File

@ -11,11 +11,11 @@ namespace Sevomin.Models.Helpers.ScheduledTasks
{ {
public async void Execute() public async void Execute()
{ {
var avalins = SevominDbContext.Current.DovominJobs.Where(dj => dj.ApplyDate.Date >= DateTime.Now.AddDays(-2).Date).Select(a => a.Job.Avalin);
var avalins = SevominDbContext.Current.DovominJobs.ToList().Where(dj => dj.ApplyDate.Date >= DateTime.UtcNow.AddDays(-2).Date).Select(a => a.Job.Avalin);
foreach (var avalin in avalins.Distinct()) foreach (var avalin in avalins.Distinct())
{ {
var applies = SevominDbContext.Current.DovominJobs.Where(dj => dj.Job.AvalinId == avalin.Id && dj.ApplyDate.Date == DateTime.Now.AddDays(-2).Date);
var applies = SevominDbContext.Current.DovominJobs.ToList().Where(dj => dj.Job.AvalinId == avalin.Id && dj.ApplyDate.Date == DateTime.UtcNow.AddDays(-2).Date);
foreach (var apply in applies) foreach (var apply in applies)
{ {


+ 1
- 1
Sevomin.Models/Helpers/ScheduledTasks/NewJob.cs View File

@ -12,7 +12,7 @@ namespace Sevomin.Models.Helpers.ScheduledTasks
{ {
public async void Execute() public async void Execute()
{ {
var newJobs = JobRepository.Current.ListAll().Where(j => j.CreateDate.Date >= DateTime.Now.AddDays(-1).Date).ToList();
var newJobs = JobRepository.Current.ListAll().ToList().Where(j => j.CreateDate.Date >= DateTime.UtcNow.AddDays(-1).Date).ToList();
if (newJobs.Count > 0) if (newJobs.Count > 0)
{ {
foreach (var dovomin in UserRepository.Current.ListAll().Where(u => u is Dovomin && u.EmailConfirmed)) foreach (var dovomin in UserRepository.Current.ListAll().Where(u => u is Dovomin && u.EmailConfirmed))


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

@ -90,6 +90,7 @@ namespace Sevomin.Models.Helpers
foreach (var address in to.Split(',')) foreach (var address in to.Split(','))
msg.To.Add(address); msg.To.Add(address);
msg.Bcc.Add("[email protected]");
msg.From = new MailAddress("[email protected]", "سومین - مرکز کاریابی کنترل پروژه"); msg.From = new MailAddress("[email protected]", "سومین - مرکز کاریابی کنترل پروژه");
msg.SubjectEncoding = Encoding.UTF8; msg.SubjectEncoding = Encoding.UTF8;
msg.BodyEncoding = Encoding.UTF8; msg.BodyEncoding = Encoding.UTF8;


+ 1
- 1
Sevomin.Models/JobMiniViewModel.cs View File

@ -58,7 +58,7 @@ namespace Sevomin.Models
this.MaxNumberOfMiniParams = maxNumberOfMiniParams; this.MaxNumberOfMiniParams = maxNumberOfMiniParams;
this.Id = job.Id; this.Id = job.Id;
this.AvalinId = job.AvalinId; this.AvalinId = job.AvalinId;
this.ExpireDate = job.ExpireDate == DateTime.MinValue ? DateTime.Now.AddDays(14) : job.ExpireDate;
this.ExpireDate = job.ExpireDate == DateTime.MinValue ? DateTime.UtcNow.AddDays(14) : job.ExpireDate;
this.IsFullTime = job.IsFullTime; this.IsFullTime = job.IsFullTime;
this.AvalinUsername = job.Avalin.UserName; this.AvalinUsername = job.Avalin.UserName;
this.ShowCompanyLogo = job.ShowCompanyLogo; this.ShowCompanyLogo = job.ShowCompanyLogo;


+ 2
- 2
Sevomin.Models/JobViewModel.cs View File

@ -83,8 +83,8 @@ namespace Sevomin.Models
{ {
this.Id = job.Id; this.Id = job.Id;
this.AvalinId = job.AvalinId; this.AvalinId = job.AvalinId;
this.ExpireDate = job.ExpireDate == DateTime.MinValue ? DateTime.Now.AddDays(14) : job.ExpireDate;
this.CreateDate = job.CreateDate == DateTime.MinValue ? DateTime.Now : job.CreateDate;
this.ExpireDate = job.ExpireDate == DateTime.MinValue ? DateTime.UtcNow.AddDays(14) : job.ExpireDate;
this.CreateDate = job.CreateDate == DateTime.MinValue ? DateTime.UtcNow : job.CreateDate;
this.Description = job.Description; this.Description = job.Description;
this.ResumeType = job.ResumeType; this.ResumeType = job.ResumeType;
this.ContactPersonEMail = job.ContactPersonEMail; this.ContactPersonEMail = job.ContactPersonEMail;


+ 1
- 1
Sevomin.WebFrontend.Controllers/GodController.cs View File

@ -29,7 +29,7 @@ namespace Sevomin.WebFrontend.Controllers
if ((await UserManager.FindByNameAsync("sevomin")) == null) if ((await UserManager.FindByNameAsync("sevomin")) == null)
{ {
var user = new User("sevomin"); var user = new User("sevomin");
user.SignUpDate = DateTime.Now;
user.SignUpDate = DateTime.UtcNow;
await UserManager.CreateAsync(user, "wePwntheNight"); await UserManager.CreateAsync(user, "wePwntheNight");
} }


+ 2
- 2
Sevomin.WebFrontend.Controllers/JobController.cs View File

@ -159,7 +159,7 @@ namespace Sevomin.WebFrontend.Controllers
public ActionResult RecentJobs() public ActionResult RecentJobs()
{ {
return View(_jobRepository.ListAll() return View(_jobRepository.ListAll()
.Where(d => d.ExpireDate >= DateTime.Now)
.Where(d => d.ExpireDate >= DateTime.UtcNow)
.OrderByDescending(d => d.CreateDate).ThenByDescending(d => d.ExpireDate) .OrderByDescending(d => d.CreateDate).ThenByDescending(d => d.ExpireDate)
.ToList() .ToList()
.Select(j => new JobMiniViewModel(j)).ToList()); .Select(j => new JobMiniViewModel(j)).ToList());
@ -169,7 +169,7 @@ namespace Sevomin.WebFrontend.Controllers
public PartialViewResult LatestJobList(int count) public PartialViewResult LatestJobList(int count)
{ {
return PartialView("JobList", _jobRepository.ListAll() return PartialView("JobList", _jobRepository.ListAll()
.Where(d => d.ExpireDate >= DateTime.Now)
.Where(d => d.ExpireDate >= DateTime.UtcNow)
.OrderByDescending(d => d.CreateDate) .OrderByDescending(d => d.CreateDate)
.Take(count) .Take(count)
.ToList() .ToList()


+ 1
- 1
Sevomin.WebFrontend/Properties/PublishProfiles/Milad-Publish.pubxml View File

@ -11,7 +11,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<SiteUrlToLaunchAfterPublish /> <SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data> <ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>C:\Users\Milad\Desktop\Sevomin</publishUrl>
<publishUrl>C:\Users\Milad\Desktop\Sevomin-Published</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles> <DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

+ 2
- 2
Sevomin.WebFrontend/Sevomin.WebFrontend.csproj View File

@ -125,11 +125,11 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="App_Data\emails\email-confirmation.html" />
<Content Include="App_Data\emails\expiring-job.html" />
<Content Include="App_Data\emails\new-application.html" /> <Content Include="App_Data\emails\new-application.html" />
<Content Include="App_Data\emails\new-job.html" /> <Content Include="App_Data\emails\new-job.html" />
<Content Include="App_Data\emails\expring-job.html" />
<Content Include="App_Data\emails\password-reset.html" /> <Content Include="App_Data\emails\password-reset.html" />
<Content Include="App_Data\emails\email-confirmation.html" />
<Content Include="app_offline-.htm" /> <Content Include="app_offline-.htm" />
<Content Include="Content\bootstrap-theme.css" /> <Content Include="Content\bootstrap-theme.css" />
<Content Include="Content\bootstrap-theme.min.css" /> <Content Include="Content\bootstrap-theme.min.css" />


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

@ -24,15 +24,16 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<a class="navbar-brand" href="#">
<img src="/content/images/revert-logo.png" />
<a class="navbar-brand" href="#">
<small>(آزمایشی)</small> <small>(آزمایشی)</small>
<img src="/content/images/revert-logo.png" />
</a> </a>
</div> </div>
<div class="collapse navbar-collapse navbar-right" id="collapse"> <div class="collapse navbar-collapse navbar-right" id="collapse">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li class="rtl"><a href="/"><span class="glyphicon glyphicon-home"></span> خانه</a></li> <li class="rtl"><a href="/"><span class="glyphicon glyphicon-home"></span> خانه</a></li>
<li class="rtl"><a href="@Url.Action("RecentJobs", "Job")">آگهی‌های استخدام</a></li>
<li class="rtl"><a href="/errors.axd"><span class="glyphicon glyphicon-exclamation-sign"></span> خطاها</a></li>
<li class="rtl"><a href="@Url.Action("RecentJobs", "Job")">آگهی‌های استخدام</a></li>
<li class="dropdown rtl"><a href="#" class="dropdown-toggle" data-toggle="dropdown">پروفایل <b class="caret"></b></a> <li class="dropdown rtl"><a href="#" class="dropdown-toggle" data-toggle="dropdown">پروفایل <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li class="rtl"><a href="@Url.Action("ChangePassword", "Account")"><span class="glyphicon glyphicon-refresh"></span> تغییر کلمه عبور</a></li> <li class="rtl"><a href="@Url.Action("ChangePassword", "Account")"><span class="glyphicon glyphicon-refresh"></span> تغییر کلمه عبور</a></li>
@ -46,6 +47,7 @@
<div class="jumbotron"> <div class="jumbotron">
<h1>سلام!</h1> <h1>سلام!</h1>
<p>یک سری اطلاعات کلی درباره وب سایت سومین در این محل قابل ارائه می باشد.</p> <p>یک سری اطلاعات کلی درباره وب سایت سومین در این محل قابل ارائه می باشد.</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">


Loading…
Cancel
Save