public async Task <IActionResult> Edit(string id, [Bind("ID,INITIAL,NAME,COMPANY_NAME,ADDRESS,PHONE,PHONE_ALT,FAX,VAT,EMAIL,WEBSITE,FISCAL_YEAR")] Store store) { if (id != store.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(store); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StoreExists(store.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(store)); }
public async Task <IActionResult> Edit(string id, [Bind("Id,Code,Bar_Code,Name,Parent_Code,Type,Unit,Rate,Is_Vatable,Remarks")] Item item) { if (id != item.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(item); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemExists(item.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(item)); }
public async Task <IActionResult> Edit(string id, [Bind("Id,Code,Parent_Code,Description,Indentation,Order,Has_Child,Modified_Date")] ItemCategory itemCategory) { if (id != itemCategory.Id) { return(NotFound()); } if (ModelState.IsValid) { try { itemCategory.ModifiedDate = DateTime.Now; _context.Update(itemCategory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemCategoryExists(itemCategory.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(itemCategory)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Code,Description")] ItemType itemType) { if (id != itemType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(itemType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemTypeExists(itemType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(itemType)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Initial,Name,Is_Active,Remarks,Cash_Drop_Limit")] Terminal terminal) { if (id != terminal.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(terminal); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TerminalExists(terminal.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(terminal)); }
public async Task <IActionResult> Edit(int id, Denomination denomination) { if (id != denomination.Id) { return(NotFound()); } if (ModelState.IsValid) { try { denomination.User_Id = User.Identity.Name; _context.Update(denomination); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DenominationExists(denomination.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Terminal_Id"] = new SelectList(_context.Terminal, "Id", "Name", denomination.Terminal_Id); return(View(denomination)); }