public async Task <IActionResult> Edit(int id, [Bind("BorrowOrderID,TranName,AccountName,StartTime,TranTime,FinishTime,IsCanceled,IsCompleted,IsTraned,OrderMoney,BorrowNote,ItemNum1,ItemNum2,ItemNum3,ItemNum4,ItemNum5,ItemNum6,ItemNum7,ItemNum8,ItemNum9,ItemNum10,ItemNum11,ItemNum12,ItemNum13,ItemNum14,ItemNum15,ItemNum16,ItemNum17,ItemNum18,ItemNum19,ItemNum20,ItemNum21,ItemNum22,ItemNum23,ItemNum24,ItemNum25,ItemNum26,ItemNum27,ItemNum28,ItemNum29,ItemNum30,ItemNum31,ItemNum32,ItemNum33,ItemNum34,ItemNum35,ItemNum36,ItemNum37,ItemNum38,ItemNum39,ItemNum40")] BorrowModel borrowModel) { if (id != borrowModel.BorrowOrderID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(borrowModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BorrowModelExists(borrowModel.BorrowOrderID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("OrderPool", "Home")); } ViewData["AccountName"] = new SelectList(_context.AccountModels.Where(x => x.Type == Models.EnumClass.EnumAccountType.ι ιδΈε), "AccountName", "AccountName", borrowModel.AccountName); return(View(borrowModel)); }
public async Task <IActionResult> Edit(int id, [Bind("DiscountID,DiscountValue,AccountName,DiscountNote")] DiscountModel discountModel) { if (id != discountModel.DiscountID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(discountModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DiscountModelExists(discountModel.DiscountID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AccountName"] = new SelectList(_context.AccountModels, "AccountName", "AccountName", discountModel.AccountName); return(View(discountModel)); }
public async Task <IActionResult> Edit(string id, [Bind("ItemName,ItemValue,ItemNote")] ItemModel itemModel) { if (id != itemModel.ItemName) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(itemModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemModelExists(itemModel.ItemName)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(itemModel)); }