public async Task <IActionResult> Create([Bind("Id,PictureBinary,MimeType,SeoFilename,AltAttribute,TitleAttribute,IsNew")] Picture picture) { if (ModelState.IsValid) { _context.Add(picture); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(picture)); }
public async Task <IActionResult> Create([Bind("Id,Name,Description,CategoryTemplateId,MetaKeywords,MetaDescription,MetaTitle,ParentCategoryId,PictureId,PageSize,AllowCustomersToSelectPageSize,PageSizeOptions,PriceRanges,ShowOnHomePage,IncludeInTopMenu,HasDiscountsApplied,SubjectToAcl,LimitedToStores,Published,Deleted,DisplayOrder,CreatedOnUtc,UpdatedOnUtc")] Category category) { if (ModelState.IsValid) { _context.Add(category); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(category)); }
public async Task <IActionResult> Create([Bind("Id,ProductTypeId,ParentGroupedProductId,VisibleIndividually,Name,ShortDescription,FullDescription,AdminComment,ProductTemplateId,ShowOnHomePage,MetaKeywords,MetaDescription,MetaTitle,IsRental,RentalPriceLength,RentalPricePeriodId,IsTaxExempt,TaxCategoryId,StockQuantity,DisplayStockAvailability,DisplayStockQuantity,MinStockQuantity,OrderMinimumQuantity,OrderMaximumQuantity,DisableBuyButton,DisableWishlistButton,Price,OldPrice,SpecialPrice,SpecialPriceStartDateTimeUtc,SpecialPriceEndDateTimeUtc,Weight,Length,Width,Height,AvailableStartDateTimeUtc,AvailableEndDateTimeUtc,DisplayOrder,Published,Deleted,CreatedOnUtc,UpdatedOnUtc")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Create([Bind("Id,CustomerGuid,Username,Email,Password,PasswordFormatId,PasswordSalt,AdminComment,IsTaxExempt,AffiliateId,VendorId,HasShoppingCartItems,Active,Deleted,IsSystemAccount,SystemName,LastIpAddress,CreatedOnUtc,LastLoginDateUtc,LastActivityDateUtc,BillingAddressId,ShippingAddressId")] Customer customer) { if (ModelState.IsValid) { _context.Add(customer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BillingAddressId"] = new SelectList(_context.Address, "Id", "Id", customer.BillingAddressId); ViewData["ShippingAddressId"] = new SelectList(_context.Address, "Id", "Id", customer.ShippingAddressId); return(View(customer)); }
public async Task <IActionResult> Create([Bind("Id,OrderGuid,CustomerId,BillingAddressId,ShippingAddressId,OrderTotal,Deleted,CreatedOnUtc")] Order order) { if (ModelState.IsValid) { _context.Add(order); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BillingAddressId"] = new SelectList(_context.Address, "Id", "Id", order.BillingAddressId); ViewData["CustomerId"] = new SelectList(_context.Customer, "Id", "Id", order.CustomerId); ViewData["ShippingAddressId"] = new SelectList(_context.Address, "Id", "Id", order.ShippingAddressId); return(View(order)); }