public ActionResult DeleteConfirmed(int id) { EMPLOYER eMPLOYER = db.EMPLOYERs.Find(id); db.EMPLOYERs.Remove(eMPLOYER); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,fullname,address,phoneNumber")] EMPLOYER eMPLOYER) { if (ModelState.IsValid) { db.Entry(eMPLOYER).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(eMPLOYER)); }
public ActionResult Create([Bind(Include = "id,fullname,address,phoneNumber")] EMPLOYER eMPLOYER) { if (ModelState.IsValid) { db.EMPLOYERs.Add(eMPLOYER); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(eMPLOYER)); }
// GET: Admin/EMPLOYER/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EMPLOYER eMPLOYER = db.EMPLOYERs.Find(id); if (eMPLOYER == null) { return(HttpNotFound()); } return(View(eMPLOYER)); }
private void ModifyEmployer(Employer employer) { try { EMPLOYER entity = _da.GetSingleBy <EMPLOYER>(p => p.Person_Id == employer.Person.Id); if (entity != null) { entity.Employer_Name = employer.Name; entity.Website = employer.Website; if (employer.Sex != null && employer.Sex.Id > 0) { entity.Sex_Id = employer.Sex.Id; } _da.Save(); } } catch (Exception) { throw; } }