Пример #1
0
        // GET: Admin/ChiSo/Details/5
        public ActionResult Details(int id, int page = 1, int pageSize = 10)
        {
            var dao   = new ChiSoDao();
            var model = dao.ListAllPaging(id, page, pageSize);

            return(View(model));
        }
Пример #2
0
        // GET: Admin/ChiSo/Edit/5
        public ActionResult Edit(int kh_id, int k_id)
        {
            var data = new ChiSoDao().ViewDetail(kh_id, k_id);

            ViewBag.kh_id = kh_id;
            ViewBag.k_id  = k_id;
            return(View(data));
        }
Пример #3
0
        // GET: Admin/ChiSo
        public ActionResult Index(int page = 1, int pageSize = 10)
        {
            var sess  = Session[QuanLyCapNuoc.common.CommonConstants.NV_ID];
            var dao   = new ChiSoDao();
            var model = dao.ListAllPagingkh(page, pageSize);

            return(View(model));
        }
Пример #4
0
        public ActionResult Edit(int kh_id, chiso collection)
        {
            if (ModelState.IsValid)
            {
                var dao = new ChiSoDao();



                var result = dao.Update(collection);
                if (result)
                {
                    return(RedirectToAction("Details/" + kh_id, "ChiSo"));
                }
                else
                {
                    ModelState.AddModelError("", " không thành công");
                }
            }
            return(View("Index"));
        }
Пример #5
0
        public ActionResult Create(chiso collection)
        {
            if (ModelState.IsValid)
            {
                var dao = new ChiSoDao();



                long id = dao.Insert(collection);
                if (id > 0)
                {
                    new BillController().Create(collection);

                    return(RedirectToAction("Index", "ChiSo"));
                }
                else
                {
                    ModelState.AddModelError("", "Ghi không thành công");
                }
            }
            return(View("Index"));
        }