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

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