public async Task <IActionResult> Edit(int id, [Bind("PriorityType,Id")] Priority priority)
        {
            if (id != priority.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(priority);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PriorityExists(priority.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(priority));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("EmployeeFirstName,EmployeeLastName,EmployeeNumber,EmployeeWorkload,FunctionId,DepartmentId,Id")] 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)));
            }
            ViewData["DepartmentId"] = new SelectList(_context.Departments, "Id", "DepartmentName", employee.DepartmentId);
            ViewData["FunctionId"]   = new SelectList(_context.Functions, "Id", "FunctionTyp", employee.FunctionId);
            return(View(employee));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("PhaseName,PhaseReview,PhaseStartDatePlanned,PhaseEndDatePlanned,PhaseStartDateRealized,PhaseEndDateRealized,PhaseProgress,ProjectId,StatusId,Id")] Phase phase)
        {
            if (id != phase.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(phase);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PhaseExists(phase.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProjectId"] = new SelectList(_context.Projects, "Id", "ProjectTitle", phase.ProjectId);
            ViewData["StatusId"]  = new SelectList(_context.Status, "Id", "StatusType", phase.StatusId);
            return(View(phase));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("FunctionTyp,Id")] Function function)
        {
            if (id != function.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(function);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FunctionExists(function.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(function));
        }
        public async Task <IActionResult> Edit(int id, [Bind("PhaseActivityName,PhaseActivityProgress,Budget,RealCosts,Expense,PhaseActivityStartDatePlanned,PhaseActivityEndDatePlanned,PhaseActivityStartDateRealized,PhaseActivityEndDateRealized,EmployeeId,PhaseId,StatusId,ProjectId,FileContent,Id")] PhasesActivity phasesActivity)
        {
            if (id != phasesActivity.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(phasesActivity);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PhasesActivityExists(phasesActivity.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeId"] = new SelectList(_context.Employees, "Id", "EmployeeFirstName", phasesActivity.EmployeeId);
            ViewData["PhaseId"]    = new SelectList(_context.Phases, "Id", "PhaseName", phasesActivity.PhaseId);
            ViewData["StatusId"]   = new SelectList(_context.Status, "Id", "StatusType", phasesActivity.StatusId);
            return(View(phasesActivity));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> Edit(int id, [Bind("ExternalCostTitle,ExternalCostAmountPlanned,ExternalCostAmountReal,CostId,PhaseActivityId,Id")] ExternalCost externalCost)
        {
            if (id != externalCost.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(externalCost);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ExternalCostExists(externalCost.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CostId"]          = new SelectList(_context.Costs, "Id", "CostTyp", externalCost.CostId);
            ViewData["PhaseActivityId"] = new SelectList(_context.PhasesActivities, "Id", "PhaseActivityName", externalCost.PhaseActivityId);
            return(View(externalCost));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> Edit(int id, [Bind("ResourceTitle,ResourcePlanned,ResourceReal,RessourceDeviation,FunctionId,PhaseActivityId,Id")] PersonnelResource personnelResource)
        {
            if (id != personnelResource.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(personnelResource);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonnelResourceExists(personnelResource.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FunctionId"]      = new SelectList(_context.Functions, "Id", "FunctionTyp", personnelResource.FunctionId);
            ViewData["PhaseActivityId"] = new SelectList(_context.PhasesActivities, "Id", "PhaseActivityName", personnelResource.PhaseActivityId);
            return(View(personnelResource));
        }
Exemplo n.º 8
0
        public async Task <IActionResult> Edit(int id, [Bind("MilestoneName,MilestoneDate,ProjectId,PhaseId,Id")] Milestone milestone)
        {
            if (id != milestone.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(milestone);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MilestoneExists(milestone.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PhaseId"]   = new SelectList(_context.Phases, "Id", "PhaseName", milestone.PhaseId);
            ViewData["ProjectId"] = new SelectList(_context.Projects, "Id", "ProjectTitle", milestone.ProjectId);
            return(View(milestone));
        }
Exemplo n.º 9
0
        public async Task <IActionResult> Edit(int id, [Bind("DepartmentName,Id")] Department department)
        {
            if (id != department.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(department);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DepartmentExists(department.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(department));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ProjectTitle,ProjectDescription,ProjectApprovalDate,ProjectStartDatePlanned,ProjectEndDatePlanned,ProjectStartDateRealized,ProjectEndDateRealized,ProjectProgress,EmployeeId,PriorityId,ProcedureModelId,StatusId,Id")] Project project)
        {
            if (id != project.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(project);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProjectExists(project.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeId"]       = new SelectList(_context.Employees, "Id", "EmployeeFirstName", project.EmployeeId);
            ViewData["PriorityId"]       = new SelectList(_context.Priorities, "Id", "PriorityType", project.PriorityId);
            ViewData["ProcedureModelId"] = new SelectList(_context.ProcedureModels, "Id", "ProcedureModelName", project.ProcedureModelId);
            ViewData["StatusId"]         = new SelectList(_context.Set <Status>(), "Id", "StatusType", project.StatusId);
            return(View(project));
        }