public async Task <IActionResult> Edit(int id, [Bind("EmpNumber,HourlyRate,MonthlyRate,DailyRate,RatesId")] Rate rate)
        {
            if (id != rate.RatesId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rate);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RateExists(rate.RatesId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpNumber"] = new SelectList(_context.PrimaryTables, "EmpNumber", "EmpNumber", rate.EmpNumber);
            return(View(rate));
        }
Exemple #2
0
        public async Task <IActionResult> Edit(int id, [Bind("EmpNumber,EnvironmentSat,JobSat,RelationshipSat,WorkLifeBalance,EmpId")] EmployeePerf employeePerf)
        {
            if (id != employeePerf.EmpId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employeePerf);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployeePerfExists(employeePerf.EmpId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpNumber"] = new SelectList(_context.PrimaryTables, "EmpNumber", "EmpNumber", employeePerf.EmpNumber);
            return(View(employeePerf));
        }
Exemple #3
0
        public async Task <IActionResult> Edit(string id, [Bind("EmpNum,Passwordhash,Passwordsalt,NameUser,SurnameUser,UserEmail,UserRole,Id")] Login login)
        {
            if (id != login.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    login.Passwordhash = _cryptography.PassWordHashing(login.Passwordhash + login.Passwordsalt);
                    _context.Update(login);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LoginExists(login.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpNum"] = new SelectList(_context.PrimaryTables, "EmpNumber", "EmpNumber", login.EmpNum);
            return(View(login));
        }
Exemple #4
0
        public async Task <IActionResult> Edit(int id, [Bind("EmpNumber,MaritalStatus,Age,Over18,NumCompaniesWorked,NumWorkingYears,DistanceFromHome,Education,EducationField,Gender")] PrimaryTable primaryTable)
        {
            if (id != primaryTable.EmpNumber)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(primaryTable);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PrimaryTableExists(primaryTable.EmpNumber))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(primaryTable));
        }
Exemple #5
0
        public async Task <IActionResult> Edit(int id, [Bind("EmpNumber,Attrition,BusinessTravel,Department,EmployeeCount,JobInvolvement,JobLevel,JobRole,Overtime,StandardHours,StockOptionLevel,YearsLastPromotion,YearsCurrentRole,YearsCurrentManager,YearsAtCompany,JobDetailsId")] Jobdetail jobdetail)
        {
            if (id != jobdetail.JobDetailsId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(jobdetail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!JobdetailExists(jobdetail.JobDetailsId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpNumber"] = new SelectList(_context.PrimaryTables, "EmpNumber", "EmpNumber", jobdetail.EmpNumber);
            return(View(jobdetail));
        }
        public async Task <IActionResult> Edit(int id, [Bind("EmpNumber,MonthlyIncome,PercentSalaryHike,SalaryId")] Salary salary)
        {
            if (id != salary.SalaryId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(salary);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SalaryExists(salary.SalaryId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpNumber"] = new SelectList(_context.PrimaryTables, "EmpNumber", "EmpNumber", salary.EmpNumber);
            return(View(salary));
        }
        public async Task <IActionResult> Edit(int id, [Bind("EmpNumber,PerformanceRating,TrainingTimesLastYear,RatingId")] ManagerRating managerRating)
        {
            if (id != managerRating.RatingId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(managerRating);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ManagerRatingExists(managerRating.RatingId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpNumber"] = new SelectList(_context.PrimaryTables, "EmpNumber", "EmpNumber", managerRating.EmpNumber);
            return(View(managerRating));
        }