public ActionResult Delete(int?id) { if (Ktdangnhap() == true) { return(View(NhaCungCapMager.GetItemById(id))); } else { return(RedirectToAction("Index", "Home")); } }
[HttpPost] // luu thong tin nhan vien tao tai khoan nhan vien public ActionResult Create(NhaCungCap dm) { try { NhaCungCapMager.insert(dm); return(RedirectToAction("Index")); } catch { return(RedirectToAction("Index", "Error")); } }
public ActionResult Edit(NhaCungCap item) { try { TaiKhoan tk = (TaiKhoan)Session["USER_SESSION"]; int id = tk.MaTK; NhanVien nv = NhanVienMager.GetbyTK(id); item.MaNVchinhsua = nv.MaNV; NhaCungCapMager.uppdate(item); return(RedirectToAction("Index")); } catch { return(RedirectToAction("Edit", item.MaNCC)); } }
} // h kiem tra session tai khoan nhan vien public ActionResult Create() { if (Ktdangnhap() == true) { List <NhaCungCap> lstcc = NhaCungCapMager.getAll(); ViewBag.nhaccc = lstcc; TaiKhoan tk = (TaiKhoan)Session["USER_SESSION"]; int id = tk.MaTK; NhanVien nv = NhanVienMager.GetbyTK(id); ViewBag.MaNv = nv.MaNV; return(View()); } else { return(RedirectToAction("Index", "Home")); } }
public ActionResult Index() { List <NhaCungCap> lst = NhaCungCapMager.getAll(); return(View(lst)); }
public ActionResult Delete(int id, FormCollection f) { NhaCungCapMager.delete(id); return(RedirectToAction("Index")); }