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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
        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));
        }