Beispiel #1
0
        // GET: Admin/Method
        public ActionResult Index(int page = 1, int pageSize = 10)
        {
            var dao   = new MethodDao();
            var model = dao.ListAllPagding(page, pageSize);

            return(View(model));
        }
Beispiel #2
0
        public ActionResult Edit(Method method)
        {
            var  dao    = new MethodDao();
            bool result = dao.UpdateMethod(method);

            if (result)
            {
                return(RedirectToAction("Index", "Transaction"));
            }
            else
            {
                ModelState.AddModelError("", "Khong them duoc");
            }
            return(View("Index", "Home"));
        }
Beispiel #3
0
        public ActionResult CreateProduct(Method method)
        {
            var dao = new MethodDao();
            int id  = dao.InsertMethod(method);

            if (id > 0)
            {
                return(RedirectToAction("Index", "Method"));
            }
            else
            {
                ModelState.AddModelError("", "Khong them san pham thanh cong");
            }
            return(View("Index", "Home"));
        }
Beispiel #4
0
        public void SetMethod(int?selectedId = null)
        {
            var dao = new MethodDao();

            ViewBag.methodId = new SelectList(dao.ListAll(), "methodId", "methodName", "selectedId");
        }
Beispiel #5
0
        public ActionResult Edit(int id)
        {
            var method = new MethodDao().GetById(id);

            return(View(method));
        }