public ActionResult Delete(int id, LoaiKyLuat loaiKyLuat) { loaiKyLuat = database.LoaiKyLuats.Where(x => x.IdloaiKl == id).FirstOrDefault(); database.Remove(loaiKyLuat); database.SaveChanges(); return(RedirectToAction("Index", "DanhGia")); }
// GET: LoaiKyLuatController/Delete/5 public ActionResult Delete(int id) { var model = new LoaiKyLuat(); model = database.LoaiKyLuats.Where(x => x.IdloaiKl == id).FirstOrDefault(); return(View(model)); }
public ActionResult Create(LoaiKyLuat loaiKyLuat) { if (ModelState.IsValid) { database.Add(loaiKyLuat); database.SaveChanges(); return(RedirectToAction("Index", "DanhGia")); } return(View(loaiKyLuat)); }
public ActionResult Edit(LoaiKyLuat loaiKyLuat) { var model = loaiKyLuat; if (ModelState.IsValid) { database.Update(model); database.SaveChanges(); return(RedirectToAction("Index", "DanhGia")); } return(View(model)); }
//// GET: LoaiKyLuatController //public ActionResult Index() //{ // return View(); //} //// GET: LoaiKyLuatController/Details/5 //public ActionResult Details(int id) //{ // return View(); //} // GET: LoaiKyLuatController/Create public ActionResult Create() { var model = new LoaiKyLuat(); return(View(model)); }