public ActionResult CreateJobOffer(JobOfferModels jo) { try { JobOffer j = new JobOffer { DateDeb = jo.DateDeb, DateFin = jo.DateFin, Experience = jo.Experience, Function = jo.Function, JobOfferDesrip = jo.JobOfferDesrip, JobOfferId = jo.JobOfferId, Poste_numb = jo.Poste_numb, Required_Profile = jo.Required_Profile }; if (j.DateDeb < j.DateFin && j.DateDeb > DateTime.Now) { Svo.Add(j); Svo.Commit(); } else { TempData["msg"] = "<script>alert('Check the start and end date of the offer');</script>"; } return(RedirectToAction("AllJobOffers")); } catch { return(View()); } }
// GET: JobOffer/Details/5 public ActionResult Details(int id) { JobOfferModels g = new JobOfferModels(); JobOffer JBO = Svo.GetById(id); g.Experience = JBO.Experience; g.DateDeb = JBO.DateDeb; g.DateFin = JBO.DateFin; g.Function = JBO.Function; g.JobOfferDesrip = JBO.JobOfferDesrip; g.Poste_numb = JBO.Poste_numb; g.Required_Profile = JBO.Required_Profile; return(View(g)); }
public ActionResult Edit(int id, JobOfferModels JBO) { JobOffer g = Svo.GetById(id); g.Experience = JBO.Experience; g.DateDeb = JBO.DateDeb; g.DateFin = JBO.DateFin; g.Function = JBO.Function; g.JobOfferDesrip = JBO.JobOfferDesrip; g.Poste_numb = JBO.Poste_numb; g.Required_Profile = JBO.Required_Profile; return(RedirectToAction("AllJobOffers")); }
// GET: JobOffer/Create public ActionResult CreateJobOffer() { JobOfferModels jp = new JobOfferModels(); return(View(jp)); }