public async Task <IActionResult> Edit(int id, [Bind("Id")] WishList wishList) { if (id != wishList.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(wishList); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WishListExists(wishList.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(wishList)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Status,ReferenceNumber,TransactionUUID,TransactionDate,Total")] Order order) { if (id != order.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(order); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrderExists(order.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(order)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,VendorItemId")] VendorItemTypeValue vendorItemTypeValue) { if (id != vendorItemTypeValue.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(vendorItemTypeValue); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VendorItemTypeValueExists(vendorItemTypeValue.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["VendorItemId"] = new SelectList(_context.VendorItems, "Id", "Id", vendorItemTypeValue.VendorItemId); return(View(vendorItemTypeValue)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Description,EstimatedCost,ActualCost,PaidCost,Notes")] Budget budget) { if (id != budget.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(budget); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BudgetExists(budget.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(budget)); }
public async Task <IActionResult> Edit(int id, [Bind("Id")] BlogCategoryRelation blogCategoryRelation) { if (id != blogCategoryRelation.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(blogCategoryRelation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BlogCategoryRelationExists(blogCategoryRelation.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(blogCategoryRelation)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Quantity,TotalPrice")] BasketItems basketItems) { if (id != basketItems.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(basketItems); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BasketItemsExists(basketItems.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(basketItems)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Title")] VendorTypeValue vendorTypeValue, int typeId) { if (id != vendorTypeValue.Id) { return(NotFound()); } var parms = new Dictionary <string, string> { { "typeId", typeId.ToString() } }; if (ModelState.IsValid) { try { var vendortype = _context.VendorTypes.Find(typeId); vendorTypeValue.VendorType = vendortype; _context.Update(vendorTypeValue); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VendorTypeValueExists(vendorTypeValue.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index), parms)); } return(View(vendorTypeValue)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,comment,author,email,subject,rating,DateIn,Status")] VendorItemReview vendorItemReviews, int itemId) { if (ModelState.IsValid) { var parms = new Dictionary <string, string> { { "itemId", itemId.ToString() } }; string userId = ""; if (!string.IsNullOrEmpty(Request.Form["User"])) { userId = Request.Form["User"]; } else { userId = _userManager.GetUserId(User); } var user = _context.Users.Find(userId); var item = _context.VendorItems.Find(itemId); _context.Update(vendorItemReviews); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index), parms)); } return(View(vendorItemReviews)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,FullName,GuestStatus,Side,Email,Phone,Address")] GuestList guestList) { if (id != guestList.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(guestList); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GuestListExists(guestList.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(guestList)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Title,HtmlDescription")] Pages pages) { if (id != pages.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pages); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PagesExists(pages.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pages)); }
public async Task <IActionResult> Edit(long id, [Bind("Id,comment,author,email,subject,rating,DateIn,Status")] VendorItemReview vendorItemReview) { if (id != vendorItemReview.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(vendorItemReview); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VendorItemReviewExists(vendorItemReview.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(vendorItemReview)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,TipsTitle,FeaturedVendorsTitle,BlogTitle,ContactAddress,ContactEmail,ContactPhone,AdminEmail,AdminEmailPassword")] WebContent webContent) { if (id != webContent.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(webContent); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WebContentExists(webContent.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(webContent)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ProfileId,AccessKey,SecuritySign,PaymentType,RecurringFrequency")] PaymentSetting paymentSetting) { if (id != paymentSetting.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(paymentSetting); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PaymentSettingExists(paymentSetting.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(paymentSetting)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Address,PhoneNumber,Latitude,Longitude,VendorItem")] VendorBranches vendorBranches, int itemId) { if (ModelState.IsValid) { var parms = new Dictionary <string, string> { { "itemId", itemId.ToString() } }; vendorBranches.VendorItemId = itemId; _context.Update(vendorBranches); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index), parms)); } ViewBag.ItemId = itemId.ToString(); return(View(vendorBranches)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Title,VendorCategoryId")] VendorType vendorType) { if (id != vendorType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(vendorType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VendorTypeExists(vendorType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewBag.Categories = new SelectList(_context.VendorCategories, "Id", "Title"); foreach (var item in ViewBag.Categories) { if (item.Value == vendorType.VendorCategoryId.ToString()) { item.Selected = true; } } return(View(vendorType)); }