public async Task <IActionResult> Create([Bind("id,SerialCode,ClientID,StartDate,EndDate,AmountOfHours")] ServiceOrder serviceOrder) { if (ModelState.IsValid) { _context.Add(serviceOrder); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(serviceOrder)); }
public async Task <IActionResult> Create([Bind("id,Start_,End_,Hours_,OnTheRanch")] Charger charger) { if (ModelState.IsValid) { _context.Add(charger); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(charger)); }
public async Task <IActionResult> Create([Bind("id,ServiceOrderID,Json")] LittleTask littleTask) { if (ModelState.IsValid) { _context.Add(littleTask); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(littleTask)); }
public async Task <IActionResult> Create([Bind("id,Name,Email,Phone,Bank,Agency,CurrentAccount,PricePerHour,GasPrice,OvertimeProfitRate")] Owner owner) { if (ModelState.IsValid) { _context.Add(owner); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(owner)); }
public async Task <IActionResult> Create([Bind("id,Name,CNPJ,MainContactEmail,Phone")] Client client) { if (ModelState.IsValid) { _context.Client.Any(); if (_context.Client.Any() == false) { client.id = 1; } else { var id = _context.Client.Last(x => x.id != 0).id; id++; client.id = id; } _context.Add(client); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(client)); }