예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("TID,Tasks")] TaskProject taskProject)
        {
            if (id != taskProject.TID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(taskProject);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TaskProjectExists(taskProject.TID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(taskProject));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Title,Name,Surname,Nickname,Position,Active")] employee employee)
        {
            if (id != employee.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employee);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!employeeExists(employee.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
예제 #3
0
        public async Task <IActionResult> Edit(string id, [Bind("ID,Title,Name,Surname,Nickname,Position,StartDate,EndDate,Tel,Email,Active")] outsource outsource)
        {
            if (id != outsource.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(outsource);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!outsourceExists(outsource.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(outsource));
        }
예제 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("ProjID,Name,Partner,Customer,StartDate")] project project)
        {
            if (id != project.ProjID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(project);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!projectExists(project.ProjID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(project));
        }
        public async Task <IActionResult> Edit(int id, [Bind("PID,Phase,FromDate,EndDate,Usage")] PhaseProject phaseProject)
        {
            if (id != phaseProject.PID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(phaseProject);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PhaseProjectExists(phaseProject.PID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(phaseProject));
        }
예제 #6
0
        public async Task <IActionResult> Edit(int id, [Bind("LID,StartDate,EndDate,note,Days")] Leave Leave)
        {
            if (id != Leave.LID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(Leave);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LeaveExists(Leave.LID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(Leave));
        }
        public async Task <IActionResult> Edit(int?id, [Bind("ID,Position,Description")] Positions positions)
        {
            if (id != positions.ID)
            {
                return(NotFound());
            }

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