//הוספת עגלה ללקוח חדש שהתחבר public async Task <IActionResult> CreateMart(Customer customer) { Mart m = new Mart(); m.Id = customer.Id; _context.Add(m); await _context.SaveChangesAsync(); return(RedirectToAction("Index", "Home")); }
public async Task <IActionResult> Create([Bind("ProductesId,SizeId,ColorId,MartId,AmountOfOrders")] Quantities quantities) { if (ModelState.IsValid) { _context.Add(quantities); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["ColorId"] = new SelectList(_context.Colors, "Id", "Id", quantities.ColorId); ViewData["MartId"] = new SelectList(_context.Mart, "Id", "Id", quantities.MartId); ViewData["ProductesId"] = new SelectList(_context.Productes, "Id", "Id", quantities.ProductesId); ViewData["SizeId"] = new SelectList(_context.Sizes, "Id", "Id", quantities.SizeId); return(View(quantities)); }
public async Task <IActionResult> Create([Bind("ProductId,ProductName,Color,Size,Price,AmountInStock,AmountOfOrders,DeliveryPrice,ImgId")] Productes productes) { if (ModelState.IsValid) { _context.Add(productes); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(productes)); }
public async Task <IActionResult> Create([Bind("MartId,CustomerId")] Mart mart) { if (ModelState.IsValid) { _context.Add(mart); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(mart)); }
public async Task <IActionResult> Create([Bind("Id,Name")] Categories categories) { if (ModelState.IsValid) { _context.Add(categories); await _context.SaveChangesAsync(); return(RedirectToAction("List")); } return(View(categories)); }
public async Task <IActionResult> Create([Bind("SubCategoryId,SubName")] SubCategory subCategory) { if (ModelState.IsValid) { _context.Add(subCategory); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(subCategory)); }
public async Task <IActionResult> Create([Bind("CustomerId,FirstName,LastName,PhoneNumber,Address,City,CreditCard,Mail,Password")] Customer customer) { if (ModelState.IsValid) { _context.Add(customer); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(customer)); }
public async Task <IActionResult> Create([Bind("SizeId,SizeName")] Size size) { if (ModelState.IsValid) { _context.Add(size); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(size)); }
public async Task <IActionResult> Create([Bind("CategoryId,Name")] Category category) { if (ModelState.IsValid) { _context.Add(category); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(category)); }
public async Task <IActionResult> Create([Bind("SubCategoryId,SubName,CategoryId")] SubCategory subCategory) { if (ModelState.IsValid) { _context.Add(subCategory); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CategoryId"] = new SelectList(_context.Category, "CategoryId", "CategoryId", subCategory.CategoryId); return(View(subCategory)); }
public async Task <IActionResult> Create([Bind("ProductId,ProductName,Price,AmountInStock,AmountOfOrders,DeliveryPrice,SubCategoryId,ImgId")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["SubCategoryId"] = new SelectList(_context.SubCategory, "SubCategoryId", "SubCategoryId", product.SubCategoryId); return(View(product)); }
public async Task <IActionResult> Create([Bind("Id,ProductName,Price,AmountInStock,AmountOfOrders,DeliveryPrice,ImgId,SubCategoryId")] Productes productes) { if (ModelState.IsValid) { _context.Add(productes); await _context.SaveChangesAsync(); return(RedirectToAction("List")); } ViewData["SubId"] = new SelectList(await _context.SubCategory.ToListAsync(), "Id", "SubName", productes.SubCategory.SubName); return(View(productes)); }
public async Task <IActionResult> Create([Bind("Id,SubName,CategoriesId")] SubCategory subCategory) { if (ModelState.IsValid) { _context.Add(subCategory); await _context.SaveChangesAsync(); return(RedirectToAction("List")); } ViewData["CategoryId"] = new SelectList(await _context.Categories.ToListAsync(), "Id", "Name", subCategory.Categories.Name); return(View(subCategory)); }
public async Task <IActionResult> Create([Bind("ProductesId,SizeId,ColorId,AmountInStock")] ConnectTable connectTable) { if (ModelState.IsValid) { _context.Add(connectTable); await _context.SaveChangesAsync(); return(RedirectToAction("List")); } ViewData["ColorId"] = new SelectList(_context.Colors, "Id", "Id", connectTable.ColorId); ViewData["ProductesId"] = new SelectList(_context.Productes, "Id", "Id", connectTable.ProductesId); ViewData["SizeId"] = new SelectList(_context.Sizes, "Id", "Id", connectTable.SizeId); return(View(connectTable)); }
public async Task <IActionResult> Create([Bind("DetailesId,ProductId,SizeId,ColorId,MartId")] ConectTable conectTable) { if (ModelState.IsValid) { _context.Add(conectTable); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ColorId"] = new SelectList(_context.Color, "ColorId", "ColorId", conectTable.ColorId); ViewData["MartId"] = new SelectList(_context.Mart, "MartId", "MartId", conectTable.MartId); ViewData["ProductId"] = new SelectList(_context.Product, "ProductId", "ProductId", conectTable.ProductId); ViewData["SizeId"] = new SelectList(_context.Set <Size>(), "SizeId", "SizeId", conectTable.SizeId); return(View(conectTable)); }