public async Task <IActionResult> Create([Bind("DetailId,Age,Attrition,Department,DistanceFromHome,Education,EducationField,EmployeeNumber,Gender,MaritalStatus,Over18")] EmployeeDetails employeeDetails)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employeeDetails);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employeeDetails));
        }
        public async Task <IActionResult> Create([Bind("CostId,DailyRate,EmployeeNumber,HourlyRate,MonthlyIncome,MonthlyRate,OverTime,PercentSalaryHike,StandardHours")] EmployeeCost employeeCost)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employeeCost);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeNumber"] = new SelectList(_context.EmployeeDetails, "EmployeeNumber", "EmployeeNumber", employeeCost.EmployeeNumber);
            return(View(employeeCost));
        }
Esempio n. 3
0
        public async Task <IActionResult> Create([Bind("JobId,BusinessTravel,Department,EmployeeNumber,JobInvolvement,JobLevel,JobRole")] JobInformation jobInformation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobInformation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeNumber"] = new SelectList(_context.EmployeeDetails, "EmployeeNumber", "EmployeeNumber", jobInformation.EmployeeNumber);
            return(View(jobInformation));
        }