public async Task <IActionResult> Create([Bind("ClientId,FirstName,LastName,SecondLastName,Observation")] Client client) { if (ModelState.IsValid) { _context.Add(client); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(client)); }
public async Task <IActionResult> Create([Bind("CommisionerId,FirstName,LastName,SecondLastName,Nic,ContractNumber,Email,CommisionerPassword")] Commisioner commisioner) { if (ModelState.IsValid) { _context.Add(commisioner); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(commisioner)); }
public async Task <IActionResult> Create([Bind("DepartmentId,DepartmentCode,NumberFloor,NumberBedrooms,DepartmentDescription,DeparmentPrice,DepartmentTypeId,DepartmentStateId")] Department department) { if (ModelState.IsValid) { _context.Add(department); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DepartmentStateId"] = new SelectList(_context.Departmentstate, "DepartmentStateId", "DepartmentStateDescription", department.DepartmentStateId); ViewData["DepartmentTypeId"] = new SelectList(_context.Departmenttype, "DepartmentTypeId", "DepartmentTypeDescription", department.DepartmentTypeId); return(View(department)); }
public async Task <IActionResult> Create([Bind("VisitRegistrationId,ReferencialPrice,ClientRegister,VisitDay,Observations,ClientId,DepartmentId,CommisionerId")] Visitregistration visitregistration) { if (ModelState.IsValid) { _context.Add(visitregistration); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ClientId"] = new SelectList(_context.Client, "ClientId", "FirstName", visitregistration.ClientId); ViewData["CommisionerId"] = new SelectList(_context.Commisioner, "CommisionerId", "CommisionerPassword", visitregistration.CommisionerId); ViewData["DepartmentId"] = new SelectList(_context.Department, "DepartmentId", "DepartmentDescription", visitregistration.DepartmentId); return(View(visitregistration)); }