public async Task <IActionResult> Create([Bind("ID,ProductName,Price,QuanitityPurchased,SubTotal")] MakeSales makeSales) { if (ModelState.IsValid) { _context.Add(makeSales); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(makeSales)); }
public async Task <IActionResult> Create([Bind("ID,Name,Description")] 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,LastName,FirstName,Email,PhoneNo")] Customer customer) { if (ModelState.IsValid) { _context.Add(customer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customer)); }
public async Task <IActionResult> Create([Bind("ID,Name,Price,QuantityAvailable,CategoryID")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CategoryID"] = new SelectList(_context.Categories, "ID", "Name", product.CategoryID); return(View(product)); }
public async Task <IActionResult> Create([Bind("ID,ProductID,QuantityPurchased,SubTotal,DatePurchased,SalesID")] SalesDetail salesDetail) { if (ModelState.IsValid) { _context.Add(salesDetail); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["SalesID"] = new SelectList(_context.Sales, "ID", "ID");//salesDetail.SalesID return(View(salesDetail)); }