// GET: TASK/Delete/5 public ActionResult Delete(int id) { TASK_ASSIGNMENT customer = new TASK_ASSIGNMENT(); customer = dao.Read(id); return(View(customer)); }
// GET: TASK/Edit/5 public ActionResult Edit(int?id) { TASK_ASSIGNMENT customer = new TASK_ASSIGNMENT(); customer = dao.Read(Convert.ToInt32(id)); return(View(customer)); }
//Update Operation public void Update(TASK_ASSIGNMENT obj) { TASK_ASSIGNMENT std = _DB.TASK_ASSIGNMENT.Find(obj.ID); std = obj; _DB.SaveChanges(); }
//Delete Operation public void Delete(int id) { TASK_ASSIGNMENT obj = new TASK_ASSIGNMENT(); obj = _DB.TASK_ASSIGNMENT.Find(id); _DB.TASK_ASSIGNMENT.Remove(obj); _DB.SaveChanges(); }
public ActionResult Create(TASK_ASSIGNMENT customer) { try { dao.Create(customer); } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); } return(RedirectToAction("Index")); }
public ActionResult Edit(int id, FormCollection formValues) { try { TASK_ASSIGNMENT customer = new TASK_ASSIGNMENT(); customer = dao.Read(id); customer.WORKER_ID = Convert.ToInt32(Request.Form["WORKER_ID"]); customer.TASK_ID = Convert.ToInt32(Request.Form["TASK_ID"]); dao.Update(customer); } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); } return(RedirectToAction("Index")); }
// GET: TASK/Create public ActionResult Create() { TASK_ASSIGNMENT customer = new TASK_ASSIGNMENT(); return(View(customer)); }
//Create Operation public void Create(TASK_ASSIGNMENT obj) { _DB.TASK_ASSIGNMENT.Add(obj); _DB.SaveChanges(); }