public async Task <IActionResult> Create([Bind("Id,Identity")] Make make) { if (ModelState.IsValid) { _context.Add(make); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(make)); }
public async Task <IActionResult> Create([Bind("Id,Identity,Price")] Repair repair) { if (ModelState.IsValid) { _context.Add(repair); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(repair)); }
public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,PrimaryPhone,AlternatePhone,Email,Street,City,State,Zip,RoleId")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["RoleId"] = new SelectList(_context.Roles, "Id", "Identity", employee.RoleId); return(View(employee)); }
public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,PrimaryPhone,AlternatePhone,CarrierId,Email,Street,City,State,Zip,ContactMethod")] Customer customer) { if (ModelState.IsValid) { _context.Add(customer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CarrierId"] = new SelectList(_context.Carriers, "Id", "Identity", customer.CarrierId); return(View(customer)); }
public async Task <IActionResult> Create([Bind("Id,CustomerId,EmployeeId,MakeId,ModelId,ColorId,Status,RepairId,IMEI")] Ticket ticket) { if (ModelState.IsValid) { _context.Add(ticket); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ColorId"] = new SelectList(_context.Colors, "Id", "Identity", ticket.ColorId); ViewData["CustomerId"] = new SelectList(_context.Customers, "Id", "FullName", ticket.CustomerId); ViewData["EmployeeId"] = new SelectList(_context.Employees, "Id", "FullName", ticket.EmployeeId); ViewData["MakeId"] = new SelectList(_context.Makes, "Id", "Identity", ticket.MakeId); ViewData["ModelId"] = new SelectList(_context.Models, "Id", "Identity", ticket.ModelId); ViewData["RepairId"] = new SelectList(_context.Repairs, "Id", "Identity", ticket.RepairId); return(View(ticket)); }