public ActionResult DeleteConfirmed(int id) { t_csr_ph t_csr_ph = db.t_csr_ph.Find(id); db.t_csr_ph.Remove(t_csr_ph); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id = 0) { t_csr_ph t_csr_ph = db.t_csr_ph.Find(id); if (t_csr_ph == null) { return(HttpNotFound()); } return(View(t_csr_ph)); }
public ActionResult Edit(int id, t_csr_ph t_csr_ph) { if (ModelState.IsValid) { using (var db = new db_esosEntities()) { var csr = db.t_csr_ph.Find(id); csr.csr_ph_name = t_csr_ph.csr_ph_name; csr.csr_ph_address = t_csr_ph.csr_ph_address; csr.csr_ph_activity = t_csr_ph.csr_ph_activity; db.SaveChanges(); return(RedirectToAction("Index")); } } else { return(View(t_csr_ph)); } }
public ActionResult Create(t_csr_ph t_csr_ph) { if (ModelState.IsValid) { using (var db = new db_esosEntities()) { var create = db.t_csr_ph.Create(); create.csr_ph_name = t_csr_ph.csr_ph_name; create.csr_ph_address = t_csr_ph.csr_ph_address; create.csr_ph_activity = t_csr_ph.csr_ph_activity; create.csr_ph_date = DateTime.Now; db.t_csr_ph.Add(create); db.SaveChanges(); return(RedirectToAction("Index")); } } else { return(View(t_csr_ph)); } }