Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 4
0
 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));
 }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
        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));
        }
Exemplo n.º 7
0
        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));
        }
Exemplo n.º 8
0
        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));
        }