public async Task <IActionResult> Create([Bind("UserId,Name,LastName,Email")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Create([Bind("BuildingId,Name,Address")] Building building) { if (ModelState.IsValid) { _context.Add(building); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(building)); }
public async Task <IActionResult> Create([Bind("VehicleId,Mark,ModelType,СarryingСapacity,YearIssue,UsefulVolume,VehicleType,OverallDimensions")] Vehicle vehicle) { if (ModelState.IsValid) { _context.Add(vehicle); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vehicle)); }
public async Task <IActionResult> Create([Bind("Id,Registedtime,InOut,UserId,BuildingId")] Registry registry) { if (ModelState.IsValid) { _context.Add(registry); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BuildingId"] = new SelectList(_context.Buildings, "BuildingId", "BuildingId", registry.BuildingId); ViewData["UserId"] = new SelectList(_context.Users, "UserId", "UserId", registry.UserId); return(View(registry)); }