public ActionResult delete(applyforjobs jobs) { var h = db.applyforjobs.Find(jobs.id); db.applyforjobs.Remove(h); db.SaveChanges(); return(RedirectToAction("getjobsbyapplaier")); }
public ActionResult edit(applyforjobs jobs) { var g = db.applyforjobs.Find(jobs.id); if (ModelState.IsValid) { g.massage = jobs.massage; g.applaydate = DateTime.Now; db.Entry(g).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("getjobsbyapplaier")); } return(View(g)); }
public ActionResult apply(applyforjobs jobs) { if (ModelState.IsValid) { var h = User.Identity.GetUserId(); var hhh = (int)Session["jobid"]; var hh = db.applyforjobs.Where(a => a.userid == h && a.jobsid == hhh).ToList(); if (hh.Count < 1) { jobs.userid = h; jobs.applaydate = DateTime.Now; jobs.jobsid = hhh; db.applyforjobs.Add(jobs); db.SaveChanges(); return(RedirectToAction("Index")); } } return(View(jobs)); }