//[Authorize(Roles = "Employee")] public ActionResult BasicDetails(EmployeeBasicDetails BasicDetails, DateTime?DateofBirth, string Name, string DOB, string Gender, string MaritalStatus, string AlternateContact, string EmployeeId, string AlternateEmail, string Nationality, string fatherName, string spouseName, bool Emplanelled = false) { string UserId = User.Identity.GetUserId(); UserViewModel userdetails = generic.GetUserDetail(UserId); //var dob = Convert.ToDateTime(DOB); DateofBirth = null; if (!String.IsNullOrEmpty(DOB)) { DateofBirth = DateTime.ParseExact(DOB, "dd-MM-yyyy", CultureInfo.InvariantCulture); } var empdetails = ems.GetEmployeeBasicDetails(UserId).FirstOrDefault(); bool result = ems.AddEmployeeBasicDetails(Name, DateofBirth, UserId, userdetails.SubscriberId, Gender, MaritalStatus, AlternateContact, AlternateEmail, Nationality, EmployeeId, Emplanelled, userdetails.DepartmentId, fatherName, spouseName); //empdetails.Status, empdetails.DateofJoining, empdetails.ProbationPeriod, empdetails.GradeId, empdetails.DateofConfirmation PopulateMaritalStatus(BasicDetails.MaritalStatus); PopulateGenderStatus(BasicDetails.Gender); PopulateNationality(BasicDetails.Nationality); return(RedirectToAction("BasicDetails", "Employee", new { area = "EMS", status = result })); }