public async Task <IActionResult> Create([Bind("Id,TraingingProgramName,StrateDate,EndDate,Description, MaxNumber")] TrainingProgram trainingProgram) { if (ModelState.IsValid) { _context.Add(trainingProgram); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(trainingProgram)); }
public async Task <IActionResult> Create([Bind("Id,DepartmentName")] Department department) { if (ModelState.IsValid) { _context.Add(department); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(department)); }
public async Task <IActionResult> Create([Bind("Id,ComputerMake,ComputerManufacturer,PurchaseDate")] Computer computer) { if (ModelState.IsValid) { _context.Add(computer); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(computer)); }
public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,DepartmentId,StartDate")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["DepartmentId"] = new SelectList(_context.Department, "Id", "DepartmentName", employee.DepartmentId); return(View(employee)); }