public ActionResult Edit(int id, LICHHEN cate) { cate.TinhTrang = "DXN"; db.Entry(cate).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Update_Check(LICHHEN lh) { //Check check = Session["Check"] as Check; //int id_lich = int.Parse(form["idLich"]); //string _check = (form["checkl"].ToString()); //check.Update_lich(id_lich, _check); //return RedirectToAction("CheckLich", "LichHen"); lh.TinhTrang = "DXN"; db.Entry(lh).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Delete(int id, LICHHEN lh) { try { lh = db.LICHHENs.Where(s => s.MaLichHen == id).FirstOrDefault(); db.LICHHENs.Remove(lh); db.SaveChanges(); return(RedirectToAction("CheckLich")); } catch { return(Content("Error Delete")); } }
public ActionResult Edit(LICHHEN lh) { try { db.Entry(lh).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("ListLichHen", "ListLichHen")); } catch { ModelState.AddModelError("NgayHen", "Vui Lòng Chọn Sau Ngày Hôm Nay "); return(View(lh)); } }
public ActionResult CreateLichHen(LICHHEN lh) { try { lh.MaLichHen = 0; String.Format("0:yyyy/mm/dd", lh.NgayHen); lh.TinhTrang = "CXN"; db.LICHHENs.Add(lh); db.SaveChanges(); return(RedirectToAction("DatLichThanhCongYta", "LichHen")); } catch { ModelState.AddModelError("NgayHen", "Vui Lòng Chọn Sau Ngày Hôm Nay "); return(View(lh)); } }
public ActionResult CheckLich(LICHHEN lh) { return(View(db.LICHHENs.ToList())); }