Example #1
0
 public ActionResult Delete(int?id)
 {
     if (Ktdangnhap() == true)
     {
         return(View(NhaCungCapMager.GetItemById(id)));
     }
     else
     {
         return(RedirectToAction("Index", "Home"));
     }
 }
Example #2
0
 [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"));
     }
 }
Example #3
0
 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));
     }
 }
Example #4
0
        } // 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"));
            }
        }
Example #5
0
        public ActionResult Index()
        {
            List <NhaCungCap> lst = NhaCungCapMager.getAll();

            return(View(lst));
        }
Example #6
0
 public ActionResult Delete(int id, FormCollection f)
 {
     NhaCungCapMager.delete(id);
     return(RedirectToAction("Index"));
 }