Exemple #1
0
        [HttpPost]  // xoa san pham , luu tt nhan vien xoa
        public ActionResult Delete(int id, FormCollection f)
        {
            TaiKhoan tk    = (TaiKhoan)Session["USER_SESSION"];
            int      idtk  = tk.MaTK;
            NhanVien nv    = NhanVienMager.GetbyTK(idtk);
            var      spxoa = SanPhamMager.delete(id);

            spxoa.MaNVchinhsua = nv.MaNV;
            spxoa.Ngaycapnhap  = DateTime.Now;
            SanPhamMager.uppdateSanPham(spxoa);

            if (spxoa != null)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }