Beispiel #1
0
        public async Task <IActionResult> Edit(string id, [Bind("VacantionRequestId,FirstName,LastName,Type,StartDate,NoOfDays,Cause")] VacantionRequest vacantionRequest)
        {
            if (id != vacantionRequest.VacantionRequestId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vacantionRequest);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VacantionRequestExists(vacantionRequest.VacantionRequestId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(vacantionRequest));
        }
        public async Task <IActionResult> Edit(string employeeId, [Bind("EmployeeId,FirstName,LastName,HolidayType,NumberOfDays,Date,NumberOfDaysConsumed,NumberOfDaysLeft")] Employee employee)
        {
            if (employeeId != employee.EmployeeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employee);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployeeExists(employee.EmployeeId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
Beispiel #3
0
        public async Task <IActionResult> Edit(string id, [Bind("VacantionId,VacantionType,VacantionDays,ConsumedDays,DaysLeft")] Vacantion vacantion)
        {
            if (id != vacantion.VacantionId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vacantion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VacantionExists(vacantion.VacantionId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(vacantion));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,City,Year,Score")] Holiday holiday)
        {
            if (id != holiday.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(holiday);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HolidayExists(holiday.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(holiday));
        }