public ActionResult DeleteConfirmed(string id) { t_staff t_staff = db.t_staff.Find(id); db.t_staff.Remove(t_staff); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "staff_id,first_name,last_name,address,dob,phone,email,gender,salary, join_date, citizenship_no, building_info,guardian_name, guardian_contact_info, guardian_relationship")] t_staff t_staff) { if (ModelState.IsValid) { staffMgr.UpdateStaff(t_staff); return(RedirectToAction("Index")); } return(View(t_staff)); }
public ActionResult Create([Bind(Include = "first_name,last_name,address,dob,phone,email,gender,salary, join_date, building_info, citizenship_no, img_file, guardian_name, guardian_contact_info, guardian_relationship")] t_staff t_staff) { if (ModelState.IsValid) { staffMgr.InsertStaff(t_staff); return(RedirectToAction("List")); } return(View(t_staff)); }
public bool UpdateStaffImage(t_staff staff) { try { _hmsDB.UpdateStaffImage(staff.staff_id, staff.img_file); return(true); } catch { return(false); } }
// GET: Staff/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } t_staff t_staff = db.t_staff.Find(id); if (t_staff == null) { return(HttpNotFound()); } return(View(t_staff)); }
public ActionResult Deactivate(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } t_staff t_staff = db.t_staff.Find(id); if (t_staff == null) { return(HttpNotFound()); } staffMgr.DeactivateStaff(t_staff); return(View("Index")); }
public ActionResult UploadImage([Bind(Include = "staff_id")] t_staff t_staff, HttpPostedFileBase image) { if (ModelState.IsValid) { if (image != null) { t_staff.img_file = ConvertToBytes(image); staffMgr.UpdateStaffImage(t_staff); } //db.t_student.Add(t_student); //db.SaveChanges(); return(RedirectToAction("Details", "Staff", new { id = t_staff.staff_id })); } return(View(t_staff)); }
public t_staff UpdateStaff(t_staff staff) { try { if (_hmsDB != null) { _hmsDB.UpdateStaff(staff.staff_id, staff.first_name, staff.last_name, staff.address, staff.dob, staff.phone, staff.email, staff.gender, staff.salary, staff.building_info, staff.guardian_name, staff.guardian_contact_info, staff.guardian_relationship, staff.join_date, staff.citizenship_no); return(staff); } return(null); } catch (Exception) { throw; } }
public bool RemoveStaff(t_staff staff) { throw new NotImplementedException(); }
public void DeactivateStaff(t_staff staff) { _hmsDB.DeactivateStaff(staff.staff_id); }