// GET: PhieuChi public ActionResult Index(int page = 1, int pageSize = 10) { var dao = new PhieuChiDao(); var model = dao.listAll(page, pageSize); return(View(model)); }
public ActionResult Create() { PhieuChi dk = new PhieuChi(); var dao = new PhieuChiDao(); dk.Ngay = DateTime.Now; dk.MaPhieuChi = dao.AutoGetMa(); return(View(dk)); }
public ActionResult Create(PhieuChi pc) { if (ModelState.IsValid) { var dao = new PhieuChiDao(); string result = dao.Insert(pc); if (result != null) { return(RedirectToAction("Index", "PhieuChi")); } } else { ModelState.AddModelError("", "Thêm phiếu chi mới không thành công"); } return(View("Index")); }
public ActionResult Edit(PhieuChi pc) { if (ModelState.IsValid) { var dao = new PhieuChiDao(); var result = dao.Update(pc); if (result) { return(RedirectToAction("Index", "PhieuChi")); } } else { ModelState.AddModelError("", "Chỉnh sửa phiếu chi không thành công"); } return(View("Index")); }
public ActionResult Edit(string id) { var sl = new PhieuChiDao().GetById(id); return(View(sl)); }