public async Task <IActionResult> Create([Bind("Id,Date,Amount,Status")] SalesRecord salesRecord) { if (ModelState.IsValid) { _context.Add(salesRecord); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(salesRecord)); }
public async Task <IActionResult> Create([Bind("Id,Name,Email,BirthDate,BaseSalary")] Seller seller) { if (ModelState.IsValid) { _context.Add(seller); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(seller)); }
public async Task <IActionResult> Create([Bind("Id,Name")] Department department) { if (ModelState.IsValid) { _context.Add(department); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(department)); }