public async Task <IActionResult> Edit(int id, [Bind("Id,label")] MerchType merchType) { if (id != merchType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(merchType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MerchTypeExists(merchType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(merchType)); }
private void AddMerchandiseItem(MerchType merchName, int? minLimit, int? maxLimit) { BuilderMgr.ClickAddMerchandiseItem(); BuilderMgr.MerchMgr.SetName(merchName.ToString()); BuilderMgr.MerchMgr.SetType(MerchandiseManager.MerchandiseType.Fixed); BuilderMgr.MerchMgr.SetFixedPrice(MerchFixedPrice); BuilderMgr.MerchMgr.ExpandAdvanced(); BuilderMgr.MerchMgr.SetMinimumLimit(minLimit); BuilderMgr.MerchMgr.SetMaximumLimit(maxLimit); BuilderMgr.MerchMgr.SaveAndClose(); }
public async Task <IActionResult> Create([Bind("Id,label")] MerchType merchType) { if (ModelState.IsValid) { _context.Add(merchType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(merchType)); }