public async Task <IActionResult> Create([Bind("StockID,Category,Price,AvalibleSize")] AvalibleStock avalibleStock) { if (ModelState.IsValid) { _context.Add(avalibleStock); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(avalibleStock)); }
public async Task <IActionResult> Create([Bind("EmployeeID,EmployeeName,Address,MobileNumber,ShiftStart,ShiftFinish")] OurEmployee ourEmployee) { if (ModelState.IsValid) { _context.Add(ourEmployee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ourEmployee)); }
public async Task <IActionResult> Create([Bind("ID,ClientID,StockID")] OnlineSale onlineSale) { if (ModelState.IsValid) { _context.Add(onlineSale); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ClientID"] = new SelectList(_context.RegularClient, "ClientID", "ClientID", onlineSale.ClientID); ViewData["StockID"] = new SelectList(_context.AvalibleStock, "StockID", "StockID", onlineSale.StockID); return(View(onlineSale)); }