public async Task <IActionResult> Edit(long id, [Bind("Id,CategoryCode,NameRu")] PaymentCategory paymentCategory) { if (id != paymentCategory.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(paymentCategory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PaymentCategoryExists(paymentCategory.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(paymentCategory)); }
public async Task <IActionResult> Edit(long id, [Bind("Id,Type,InterfaceType,Name,Required,Direction,DontShow,Mask,Title,Comment,MinLength,MaxLength,RegExp,DontTicket")] ProviderField providerField) { if (id != providerField.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(providerField); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProviderFieldExists(providerField.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(providerField)); }
public async Task <IActionResult> Edit(long id, [Bind("Id,ProviderCode,NameRu,PaymentInfoId,CatalogCode,CategoryId,Deleted,Mrlist,MultiCheck,NoSavePt,Check,IsSupportRequestRSTEP,Order,ChequeName,RegionString")] PaymentProvider paymentProvider) { if (id != paymentProvider.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(paymentProvider); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PaymentProviderExists(paymentProvider.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CategoryId"] = new SelectList(_context.Categories, "Id", "Id", paymentProvider.CategoryId); return(View(paymentProvider)); }