|
@ -1,16 +1,14 @@ |
|
|
using System; |
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
|
|
|
|
using Microsoft.AspNet.Identity.EntityFramework; |
|
|
|
|
|
using Sevomin.Models; |
|
|
|
|
|
using Sevomin.Models.Enums; |
|
|
|
|
|
using Sevomin.Models.Helpers; |
|
|
|
|
|
using Sevomin.Models.Repositories; |
|
|
|
|
|
using System; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using System.Web.Mvc; |
|
|
|
|
|
using Sevomin.Models; |
|
|
|
|
|
using Sevomin.Models.Repositories; |
|
|
|
|
|
using Microsoft.AspNet.Identity; |
|
|
|
|
|
using Microsoft.AspNet.Identity.EntityFramework; |
|
|
|
|
|
using Sevomin.Models.Helpers; |
|
|
|
|
|
using System.Web; |
|
|
using System.Web; |
|
|
using Sevomin.Models.Enums; |
|
|
|
|
|
|
|
|
using System.Web.Mvc; |
|
|
|
|
|
|
|
|
namespace Sevomin.WebFrontend.Controllers |
|
|
namespace Sevomin.WebFrontend.Controllers |
|
|
{ |
|
|
{ |
|
@ -68,13 +66,16 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
ContactPersonEMail, IsFullTime, ShowCompanyName, |
|
|
ContactPersonEMail, IsFullTime, ShowCompanyName, |
|
|
Description, ShowCompanyLogo, ResumeType, form, job); |
|
|
Description, ShowCompanyLogo, ResumeType, form, job); |
|
|
JobRepository.Current.Save(); |
|
|
JobRepository.Current.Save(); |
|
|
|
|
|
|
|
|
|
|
|
ViewBag.Result = new PostResultViewModel(true, "آگهی شما با موفقیت منتشر شد."); |
|
|
|
|
|
|
|
|
|
|
|
return RedirectToAction("SingleJob", new { jobId = job.Id }); |
|
|
} |
|
|
} |
|
|
catch (Exception) |
|
|
catch (Exception) |
|
|
{ |
|
|
{ |
|
|
JobViewModel jvm = new JobViewModel(job); |
|
|
|
|
|
return View(jvm); |
|
|
|
|
|
|
|
|
ViewBag.Result = new PostResultViewModel(true, "در انتشار آگهی خطایی پیش آمده."); |
|
|
|
|
|
return View(new JobViewModel(job)); |
|
|
} |
|
|
} |
|
|
return Content("boogh: " + job.Id.ToString()); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private async Task<Job> FetchJob(long id) |
|
|
private async Task<Job> FetchJob(long id) |
|
@ -108,13 +109,17 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
ContactPersonEMail, IsFullTime, ShowCompanyName, |
|
|
ContactPersonEMail, IsFullTime, ShowCompanyName, |
|
|
Description, ShowCompanyLogo, ResumeType, form, job); |
|
|
Description, ShowCompanyLogo, ResumeType, form, job); |
|
|
JobRepository.Current.Save(); |
|
|
JobRepository.Current.Save(); |
|
|
|
|
|
|
|
|
|
|
|
ViewBag.Result = new PostResultViewModel(true, "آگهی شما با موفقیت به روز رسانی شد."); |
|
|
|
|
|
|
|
|
|
|
|
return View(new JobViewModel(job)); |
|
|
} |
|
|
} |
|
|
catch (Exception) |
|
|
catch (Exception) |
|
|
{ |
|
|
{ |
|
|
JobViewModel jvm = new JobViewModel(job); |
|
|
|
|
|
return View(jvm); |
|
|
|
|
|
|
|
|
ViewBag.Result = new PostResultViewModel(false, "در به روز رسانی آگهی خطایی پیش آمد."); |
|
|
|
|
|
|
|
|
|
|
|
return View(new JobViewModel(job)); |
|
|
} |
|
|
} |
|
|
return Content("boogh: " + job.Id.ToString()); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public PartialViewResult LatestJobList(int count) |
|
|
public PartialViewResult LatestJobList(int count) |
|
@ -143,7 +148,52 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
|
|
|
|
|
|
return View(viewModel); |
|
|
return View(viewModel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Authorize(Roles = "Dovomin")] |
|
|
|
|
|
public async Task<ActionResult> Apply(long jobId) |
|
|
|
|
|
{ |
|
|
|
|
|
Dovomin user = (await UserManager.FindByNameAsync(User.Identity.Name)) as Dovomin; |
|
|
|
|
|
Job job = _JobRepository.Find(jobId); |
|
|
|
|
|
if (user == null || job == null) |
|
|
|
|
|
return HttpNotFound(); |
|
|
|
|
|
|
|
|
|
|
|
DovominJob dj = new DovominJob(user, job); |
|
|
|
|
|
|
|
|
|
|
|
JobMiniViewModel jvm = new JobMiniViewModel(job, 3); |
|
|
|
|
|
StringBuilder sb = new StringBuilder("کارشناس برنامه ریزی و کنترل پروژه "); |
|
|
|
|
|
foreach (var param in jvm.Parameters) |
|
|
|
|
|
sb.Append(string.Format(param.Item1 + " ", param.Item2)); |
|
|
|
|
|
|
|
|
|
|
|
ViewBag.ShortJobDescription = sb.ToString(); |
|
|
|
|
|
ViewBag.Job = new JobViewModel(job); |
|
|
|
|
|
|
|
|
|
|
|
return View(new DovominJobViewModel(dj)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Authorize(Roles = "Dovomin")] |
|
|
|
|
|
[HttpPost] |
|
|
|
|
|
[ValidateAntiForgeryToken] |
|
|
|
|
|
public async Task<ActionResult> Apply(long jobId, string CoverLetter) |
|
|
|
|
|
{ |
|
|
|
|
|
Dovomin user = (await UserManager.FindByNameAsync(User.Identity.Name)) as Dovomin; |
|
|
|
|
|
Job job = _JobRepository.Find(jobId); |
|
|
|
|
|
if (user == null || job == null) |
|
|
|
|
|
return HttpNotFound(); |
|
|
|
|
|
|
|
|
|
|
|
_JobRepository.Apply(user, job, CoverLetter); |
|
|
|
|
|
|
|
|
|
|
|
JobMiniViewModel jvm = new JobMiniViewModel(job, 3); |
|
|
|
|
|
StringBuilder sb = new StringBuilder("کارشناس برنامه ریزی و کنترل پروژه "); |
|
|
|
|
|
foreach (var param in jvm.Parameters) |
|
|
|
|
|
sb.Append(string.Format(param.Item1 + " ", param.Item2)); |
|
|
|
|
|
|
|
|
|
|
|
ViewBag.ShortJobDescription = sb.ToString(); |
|
|
|
|
|
ViewBag.Job = new JobViewModel(job); |
|
|
|
|
|
|
|
|
|
|
|
ViewBag.Result = new PostResultViewModel(true, "اعلام آمادگی شما برای این فرصت شغلی ثبت شد."); |
|
|
|
|
|
|
|
|
|
|
|
return View(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void UpdateFields(string JalaliExpireDate, string ContactPersonName, string ContactPersonPhone, string ContactPersonEMail, bool IsFullTime, bool ShowCompanyName, string Description, bool ShowCompanyLogo, ResumeTypes ResumeType, FormCollection form, Job job) |
|
|
private static void UpdateFields(string JalaliExpireDate, string ContactPersonName, string ContactPersonPhone, string ContactPersonEMail, bool IsFullTime, bool ShowCompanyName, string Description, bool ShowCompanyLogo, ResumeTypes ResumeType, FormCollection form, Job job) |
|
@ -176,6 +226,5 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |