Пример #1
0
        public ActionResult Menu()
        {
            HangF hf  = new HangF();
            var   lst = hf.Hangs.ToList();

            return(PartialView("MenuH", lst));
        }
Пример #2
0
        public ActionResult Xoa(string id)
        {
            MyDBContext db    = new MyDBContext();
            HangF       hf    = new HangF();
            Hang        model = hf.ChitietHang(id);

            return(View(model));
        }
Пример #3
0
        public ActionResult Xoa(Hang model)
        {
            HangF hf = new HangF();

            try
            {
                if (hf.Delete(model.IDHang))
                {
                    return(RedirectToAction("DanhSachHang"));
                }
                else
                {
                    return(View());
                }
            }
            catch
            {
                return(View());
            }
        }
Пример #4
0
        public ActionResult Them(Hang model)
        {
            HangF hf = new HangF();

            try
            {
                if (hf.InSert(model))
                {
                    return(RedirectToAction("DanhSachHang"));
                }
                else
                {
                    return(View());
                }
            }
            catch
            {
                return(View());
            }
        }