public ActionResult Create(Employee Employee, string userid) { if (ModelState.IsValid) { if (Employee.TERMINATE) { Employee.DATETERMINATE = DateTime.Now; } Employee.COMPANYSITE = int.Parse(Session["companysite"].ToString()); var EMP = EM.Add(Employee, Session["userid"].ToString()); EMP.SIDEMPLOYEE = EMP.SID; EM.AddHistory(EMP, Session["userid"].ToString()); TempData["successmessage"] = "Saved successfully"; return(RedirectToAction("Create")); } else { Employee.GetSelectListSex = GetSelectListSex(); Employee.GetSelectListRace = GetSelectListRace(); Employee.GetSelectListEducationLevel = GetSelectListEducationLevel(); Employee.GetSelectListInstitution = GetSelectListInstitution(); Employee.GetSelectListReligion = GetSelectListReligion(); Employee.GetSelectListNationality = GetSelectListNationality(); Employee.GetSelectListProgramOfStudy = GetSelectListProgramOfStudy(); Employee.GetSelectListMaritalStatus = GetSelectListMaritalStatus(); Employee.GetSelectListFamilyRiceStatus = GetSelectListFamilyRiceStatus(); Employee.GetSelectListFamilyTaxStatus = GetSelectListFamilyTaxStatus(); Employee.GetSelectListNatureType = GetSelectListNatureType(); Employee.GetSelectListDepartment = GetSelectListDepartment(); Employee.GetSelectListGrade = GetSelectListGrade(); Employee.GetSelectListEmployeeType = GetSelectListEmployeeType(); Employee.GetSelectListEmployeeSection = GetSelectListEmployeeSection(); Employee.GetSelectListEmployeePosition = GetSelectListEmployeePosition(); Employee.GetSelectListPaymentMethod = GetSelectListPaymentMethod(); Employee.GetSelectListBank = GetSelectListBank(); return(View(Employee)); } }