public ActionResult Delete(int id, LoaiKhenThuong loaiKhenThuong) { loaiKhenThuong = database.LoaiKhenThuongs.Where(x => x.IdloaiKt == id).FirstOrDefault(); database.Remove(loaiKhenThuong); database.SaveChanges(); return(RedirectToAction("Index", "DanhGia")); }
// GET: LoaiKhenThuongController/Delete/5 public ActionResult Delete(int id) { var model = new LoaiKhenThuong(); model = database.LoaiKhenThuongs.Where(x => x.IdloaiKt == id).FirstOrDefault(); return(View(model)); }
public ActionResult Create(LoaiKhenThuong loaiKhenThuong) { if (ModelState.IsValid) { database.Add(loaiKhenThuong); database.SaveChanges(); return(RedirectToAction("Index", "DanhGia")); } return(View(loaiKhenThuong)); }
public ActionResult Edit(LoaiKhenThuong loaiKhenThuong) { var model = loaiKhenThuong; if (ModelState.IsValid) { database.Update(model); database.SaveChanges(); return(RedirectToAction("Index", "DanhGia")); } return(View(model)); }
public int Update(LoaiKhenThuong obj) { SqlParameter[] para = { new SqlParameter("IDLoaiKhenThuong", obj.IDLoaiKhenThuong), new SqlParameter("TenLoaiKhenThuong", obj.TenLoaiKhenThuong), new SqlParameter("HinhThuc", obj.HinhThuc), new SqlParameter("SoTien", obj.SoTien), new SqlParameter("GhiChu", obj.GhiChu), }; return(db.ExecuteSQL("LoaiKhenThuong_Update", para)); }
//// GET: LoaiKhenThuongController //public ActionResult Index() //{ // return View(); //} //// GET: LoaiKhenThuongController/Details/5 //public ActionResult Details(int id) //{ // return View(); //} // GET: LoaiKhenThuongController/Create public ActionResult Create() { var model = new LoaiKhenThuong(); return(View(model)); }
public int Update(LoaiKhenThuong obj) { return(dao.Update(obj)); }
public int Insert(LoaiKhenThuong obj) { return(dao.Insert(obj)); }