public async Task <ActionResult> Edit([Bind(Include = "id,name")] MenuType menuType) { if (ModelState.IsValid) { db.Entry(menuType).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(menuType)); }
public async Task <ActionResult> Edit([Bind(Include = "id,name,sale,status")] Discount discount) { if (ModelState.IsValid) { db.Entry(discount).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(discount)); }
public async Task <ActionResult> Edit([Bind(Include = "id,name,metatitle,status")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(category)); }
public async Task <ActionResult> Edit([Bind(Include = "id,username,password,groupid,name,gender,birthday,address,phone,email,status")] Account account) { if (ModelState.IsValid) { db.Entry(account).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.groupid = new SelectList(db.AccountGroups, "id", "name", account.groupid); return(View(account)); }
public async Task <ActionResult> Edit([Bind(Include = "id,name,metatitle,author,idCategory,price,status,image")] Book book) { if (ModelState.IsValid) { db.Entry(book).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.idCategory = new SelectList(db.Categories, "id", "name", book.idCategory); return(View(book)); }
public async Task <ActionResult> Edit([Bind(Include = "id,name,link,displayorder,status,typeid")] Menu menu) { if (ModelState.IsValid) { db.Entry(menu).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.typeid = new SelectList(db.MenuTypes, "id", "name", menu.typeid); return(View(menu)); }
public async Task <ActionResult> Edit([Bind(Include = "id,idBill,quantity,price")] BillDetail billDetail) { if (ModelState.IsValid) { db.Entry(billDetail).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.idBill = new SelectList(db.Bills, "id", "shipaddress", billDetail.idBill); return(View(billDetail)); }
public async Task <ActionResult> Edit([Bind(Include = "id,idCustomer,idDiscount,sale,checkin,shipaddress,shipMobile,shipname,shipemail")] Bill bill) { if (ModelState.IsValid) { db.Entry(bill).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.idCustomer = new SelectList(db.Accounts, "id", "username", bill.idCustomer); ViewBag.idDiscount = new SelectList(db.Discounts, "id", "id", bill.idDiscount); return(View(bill)); }