Пример #1
0
        public ActionResult Danhsachcanmua()
        {
            var sp   = new SanPhamCanMuaModel();
            var temp = sp.getDS(0, 5);

            return(View(temp));
        }
Пример #2
0
        public ActionResult ChitietAuction(SanPhamCanMua a)
        {
            var sp = new SanPhamCanMuaModel();

            a.SanPham = sp.getSP(a.SanPhamId);
            return(View(a));
        }
Пример #3
0
        public ActionResult TimSPCM(string key, int?page)
        {
            var spcm = new SanPhamCanMuaModel();

            ViewBag.key = key;
            return(PhanTrangSPCM(spcm.TimSPCM(key), page, null));
        }
Пример #4
0
        public ActionResult KyHopDong(string id)
        {
            var sp = new SanPhamCanMuaModel();

            sp.DeleteSPCM(Convert.ToInt32(id));
            return(TimDS(null, null, null, null));
        }
Пример #5
0
        public ActionResult ChitietSanphamAuction(int spcm)
        {
            var spmodel = new SanPhamCanMuaModel();
            var temp    = spmodel.getSanphamcanmua(spcm);

            temp.SanPham = spmodel.getSP(temp.SanPhamId);
            return(View(temp));
        }
Пример #6
0
 public ActionResult MultibleDel(List <string> lstdel)
 {
     foreach (var item in lstdel)
     {
         var ncc = new SanPhamCanMuaModel();
         ncc.DeleteSPCM(Convert.ToInt32(item));
     }
     return(TimSPCM(null, null));
 }
Пример #7
0
 public ActionResult EditSPCM(SanPhamCanMuaEdit loai)
 {
     if (ModelState.IsValid)
     {
         var ncc = new SanPhamCanMuaModel();
         ncc.EditSPCM(loai);
         return(RedirectToAction("Index"));
     }
     return(RedirectToAction("EditSPCM", loai.ID));
 }
Пример #8
0
 public ActionResult ThemSPCM(SanPhamCanMuaAdd loai)
 {
     if (ModelState.IsValid)
     {
         var ncc = new SanPhamCanMuaModel();
         ncc.ThemSPCM(GetData(loai));
         return(View("Index"));
     }
     return(View("Index", loai));
 }
Пример #9
0
        public ActionResult DeleteSPCM(int id)
        {
            var ncc = new SanPhamCanMuaModel();

            if (ncc.getSanphamcanmua(id) == null)
            {
                return(HttpNotFound());
            }
            ncc.DeleteSPCM(id);
            return(TimSPCM(null, null));
        }
Пример #10
0
        public ActionResult EditSPCM(int id)
        {
            var sp    = new SanPhamCanMuaModel();
            var s     = sp.getSanphamcanmua(id);
            var model = new SanPhamCanMuaEdit();

            model.ID          = s.Id;
            model.Mota        = s.Mota;
            model.Ngayketthuc = s.Ngayketthuc;
            model.Soluong     = s.Soluong;
            return(View(model));
        }