Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("VacantionRequestId,FirstName,LastName,Type,StartDate,NoOfDays,Cause")] VacantionRequest vacantionRequest)
        {
            if (ModelState.IsValid)
            {
                _context.Add(vacantionRequest);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(vacantionRequest));
        }
        public async Task <IActionResult> Create([Bind("EmployeeId,FirstName,LastName,HolidayType,NumberOfDays,Date,NumberOfDaysConsumed,NumberOfDaysLeft")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("VacantionId,VacantionType,VacantionDays,ConsumedDays,DaysLeft")] Vacantion vacantion)
        {
            if (ModelState.IsValid)
            {
                _context.Add(vacantion);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(vacantion));
        }
        public async Task <IActionResult> Create([Bind("Id,City,Year,Score")] Holiday holiday)
        {
            if (ModelState.IsValid)
            {
                _context.Add(holiday);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(holiday));
        }