示例#1
0
 public ActionResult Edit([Bind(Include = "MaUR,UserRole1")] UserRole userRole)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userRole).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(userRole));
 }
 public ActionResult Edit([Bind(Include = "MaLoai,TenLoai")] LoaiSP loaiSP)
 {
     if (ModelState.IsValid)
     {
         db.Entry(loaiSP).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(loaiSP));
 }
 public ActionResult Edit([Bind(Include = "MaKH,TenKH,Sdt,Diachi,TenDN,MK,MaUR")] KhachHang khachHang)
 {
     if (ModelState.IsValid)
     {
         db.Entry(khachHang).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaUR = new SelectList(db.UserRoles, "MaUR", "UserRole1", khachHang.MaUR);
     return(View(khachHang));
 }
示例#4
0
 public ActionResult Edit([Bind(Include = "MaDH,ThanhTien,Ngaylap,Tinhtrang,Nguoitao,MaKH,SDT,DiaChi,PhuongThucThanhToan")] DonHang donHang)
 {
     if (ModelState.IsValid)
     {
         db.Entry(donHang).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaKH = new SelectList(db.KhachHangs, "MaKH", "TenKH", donHang.MaKH);
     ViewBag.PhuongThucThanhToan = new SelectList(db.PhuongThucThanhToans, "id", "PhuongThucThanhToan1", donHang.PhuongThucThanhToan);
     return(View(donHang));
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "MaDH,MaSP,LoaiSP,TenSP,SL,Gia,MaChiTietDH")] ChiTietDH chiTietDH)
 {
     if (ModelState.IsValid)
     {
         db.Entry(chiTietDH).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaSP = new SelectList(db.SanPhams, "MaSP", "TenSP", chiTietDH.MaSP);
     ViewBag.MaDH = new SelectList(db.DonHangs, "MaDH", "Tinhtrang", chiTietDH.MaDH);
     return(View(chiTietDH));
 }