public async Task <IActionResult> Create([Bind("Id,Description,Created_at,Updated_at")] Block block) { if (ModelState.IsValid) { _context.Add(block); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(block)); }
public async Task <IActionResult> Create([Bind("Id,Description,TypeEquipament,Status,Created_at,Updated_at")] Equipament equipament) { if (ModelState.IsValid) { _context.Add(equipament); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(equipament)); }
public async Task <IActionResult> Create([Bind("Id,Name,UF,Created_at,Updated_at")] State state) { if (ModelState.IsValid) { _context.Add(state); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(state)); }
public async Task <IActionResult> Create([Bind("Id,Name,Email,Username,Password,Created_at,Updated_at")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Create([Bind("Id,Name,NameResponsible,Email,Address,Phone,CityId,Created_at,Updated_at")] Client client) { if (ModelState.IsValid) { _context.Add(client); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CityId"] = new SelectList(_context.City, "Id", "Name", client.CityId); return(View(client)); }
public async Task <IActionResult> Create([Bind("Id,Name,StateId,Created_at,Updated_at")] City city) { if (ModelState.IsValid) { _context.Add(city); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StateId"] = new SelectList(_context.State, "Id", "Name", city.StateId); return(View(city)); }
public async Task <IActionResult> Create([Bind("Id,ClientId,Description,UserId,Created_at,Updated_at")] Survey survey) { if (ModelState.IsValid) { _context.Add(survey); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ClientId"] = new SelectList(_context.Client, "Id", "Id", survey.ClientId); ViewData["UserId"] = new SelectList(_context.User, "Id", "Email", survey.UserId); return(View(survey)); }
public async Task <IActionResult> Create([Bind("Id,Name,Email,Address,UserId,CityId,Created_at,Updated_at")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CityId"] = new SelectList(_context.City, "Id", "Name", employee.CityId); ViewData["UserId"] = new SelectList(_context.User, "Id", "Email", employee.UserId); return(View(employee)); }
public async Task <IActionResult> Create([Bind("Id,SurveyId,BlockId,FlooringId,EquipamentId")] SurveyResources surveyResources) { if (ModelState.IsValid) { _context.Add(surveyResources); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BlockId"] = new SelectList(_context.Block, "Id", "Id", surveyResources.BlockId); ViewData["EquipamentId"] = new SelectList(_context.Equipament, "Id", "Id", surveyResources.EquipamentId); ViewData["FlooringId"] = new SelectList(_context.Flooring, "Id", "Id", surveyResources.FlooringId); ViewData["SurveyId"] = new SelectList(_context.Survey, "Id", "Id", surveyResources.SurveyId); return(View(surveyResources)); }