public ActionResult EditSPCM(SanPhamCanMuaEdit loai) { if (ModelState.IsValid) { SanphamcanmuaModel ncc = new SanphamcanmuaModel(); ncc.EditSPCM(loai); return(RedirectToAction("Index")); } return(RedirectToAction("EditSPCM", loai.ID)); }
public ActionResult EditSPCM(int id) { SanphamcanmuaModel sp = new SanphamcanmuaModel(); var s = sp.getSanphamcanmua(id); SanPhamCanMuaEdit model = new SanPhamCanMuaEdit(); model.ID = s.ID; model.Mota = s.Mota; model.Ngayketthuc = s.Ngayketthuc; model.Soluong = s.Soluong; return(View(model)); }