public ActionResult Edit([Bind(Include = "MaPhieuThu,MaDaiLy,NgayNop,SoTienNop")] PhieuThu phieuThu) { if (ModelState.IsValid) { DbContextTransaction tran = db.Database.BeginTransaction(); try { TempData["notice"] = "Successfully edit"; TempData["ma"] = phieuThu.MaPhieuThu; phieuThu.Flag = true; db.Entry(phieuThu).State = EntityState.Modified; db.SaveChanges(); tran.Commit(); tran.Dispose(); } catch { tran.Rollback(); tran.Dispose(); } return(RedirectToAction("Index")); } ViewBag.MaDaiLy = new SelectList(db.DaiLies, "MaDaiLy", "TenDaiLy", phieuThu.MaDaiLy); return(View(phieuThu)); }
public ActionResult Edit([Bind(Include = "MaDaiLy,MaLoaiVeSo,SoLuong,NgayNhan,SLBan,DoanhThuDPH,HoaHong,TienThanhToan,Flag")] PhatHanh ph) { if (ModelState.IsValid) { TempData["notice"] = "Successfully edit"; TempData["tensanpham"] = ph.MaLoaiVeSo; db.Entry(ph).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ph)); }
public ActionResult Edit([Bind(Include = "MaDaiLy,TenDaiLy,DiaChi,SDT,Flag")] DaiLy dl) { if (ModelState.IsValid) { TempData["notice"] = "Successfully edit"; TempData["tensanpham"] = dl.TenDaiLy; db.Entry(dl).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dl)); }
public ActionResult Edit([Bind(Include = "ID,MaDaiLy,NgayDK,SoLuongDK1,Flag")] SoLuongDK sldk) { if (ModelState.IsValid) { TempData["notice"] = "Successfully edit"; TempData["tensanpham"] = sldk.ID; db.Entry(sldk).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sldk)); }
public ActionResult Edit(PhatHanh ph) { if (ModelState.IsValid) { ph.HoaHong = Convert.ToInt32(ph.HoaHong); TempData["notice"] = "Successfully edit"; TempData["tensanpham"] = ph.MaLoaiVeSo; db.Entry(ph).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ph)); }
public ActionResult Edit([Bind(Include = "ID,MaLoaiVeSo,MaGiai,NgaySo,SoTrung")] KetQuaSoXo ketQuaSoXo) { if (ModelState.IsValid) { TempData["notice"] = "Successfully edit"; TempData["tensanpham"] = ketQuaSoXo.ID; ketQuaSoXo.Flag = true; db.Entry(ketQuaSoXo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ketQuaSoXo)); }
public ActionResult Edit([Bind(Include = "MaLoaiVeSo,Tinh,Flag")] LoaiVeso loaiVeso) { if (ModelState.IsValid) { TempData["notice"] = "Successfully edit"; TempData["tensanpham"] = loaiVeso.MaLoaiVeSo; loaiVeso.Flag = true; db.Entry(loaiVeso).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(loaiVeso)); }
public ActionResult Edit([Bind(Include = "MaDaiLy,MaLoaiVeSo,SoLuong,NgayNhan,SLBan,DoanhThuDPH,HoaHong,TienThanhToan,Flag")] PhatHanh ph) { if (ModelState.IsValid) { //ph.HoaHong = 10; string hoa = ph.HoaHong.ToString(); hoa = hoa.Substring(0, 2); int hoah = int.Parse(hoa); ph.HoaHong = hoah; TempData["notice"] = "Successfully edit"; TempData["tensanpham"] = ph.MaLoaiVeSo; db.Entry(ph).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ph)); }
public ActionResult Edit([Bind(Include = "MaPhieuChi,Ngay,NoiDung,SoTien")] PhieuChi phieuChi) { if (ModelState.IsValid) { DbContextTransaction tran = db.Database.BeginTransaction(); try { TempData["notice"] = "Successfully edit"; TempData["ma"] = phieuChi.MaPhieuChi; db.Entry(phieuChi).State = EntityState.Modified; db.SaveChanges(); tran.Commit(); tran.Dispose(); } catch { tran.Rollback(); tran.Dispose(); } return(RedirectToAction("Index")); } return(View(phieuChi)); }
public ActionResult Edit([Bind(Include = "MaGiai,TenGiai,SoTienNhan,Flag")] Giai giai) { if (ModelState.IsValid) { DbContextTransaction tran = db.Database.BeginTransaction(); try { TempData["notice"] = "Successfully edit"; TempData["tengiai"] = giai.TenGiai; db.Entry(giai).State = EntityState.Modified; db.SaveChanges(); tran.Commit(); tran.Dispose(); } catch { tran.Rollback(); tran.Dispose(); } return(RedirectToAction("Index")); } return(View(giai)); }