public ActionResult ConfigureEditReason(int?reasonId) { try { ExitViewModel Exitmodel = new ExitViewModel(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); Exitmodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); Exitmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); EmployeeDAL EmployeeDAL = new EmployeeDAL(); Exitmodel.SearchedUserDetails.EmployeeId = EmployeeDAL.GetEmployeeID(Membership.GetUser().UserName); ConfigurationDAL dal = new ConfigurationDAL(); if (reasonId != null) { v_tbl_HR_Reasons reasonRecord = dal.getReason(reasonId); Exitmodel.Reason = reasonRecord.Reason; Exitmodel.tag = Convert.ToString(reasonRecord.TagID); Exitmodel.TagID = reasonRecord.TagID; Exitmodel.ReasonID = reasonRecord.ReasonID; } Exitmodel.ReasonID = reasonId.HasValue ? reasonId.Value : 0; return(PartialView("_ReasonDetails", Exitmodel)); } catch { throw; } }
//Configure Separation Reasons public ActionResult ConfigureSeperationReason() { try { ExitViewModel Exitmodel = new ExitViewModel(); string employeeCode = Membership.GetUser().UserName; string[] role = Roles.GetRolesForUser(employeeCode); Exitmodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); Exitmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); EmployeeDAL emmployeeDAL = new EmployeeDAL(); Exitmodel.SearchedUserDetails.EmployeeId = emmployeeDAL.GetEmployeeID(employeeCode); Exitmodel.SearchedUserDetails.EmployeeCode = employeeCode; ConfigurationDAL dal = new ConfigurationDAL(); List <SeperationReasons> seperationReason = dal.getSeperationReason(); Exitmodel.CountRecord = seperationReason.Count; Exitmodel.seperationReason = seperationReason; return(PartialView("_SeperationReasonDetails", Exitmodel)); } catch { throw; } }
public ActionResult ConfigureSeparationEditCheckList(int?QuestionnaireID) { try { ExitViewModel Exitmodel = new ExitViewModel(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); Exitmodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); Exitmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL dal = new ConfigurationDAL(); if (QuestionnaireID != null) { ExitViewModel SeperationCheckList = dal.getCheckList(QuestionnaireID); Exitmodel.QuestionnaireID = SeperationCheckList.QuestionnaireID; Exitmodel.QuestionnaireName = SeperationCheckList.QuestionnaireName; Exitmodel.QuestionnaireDescription = SeperationCheckList.QuestionnaireDescription; Exitmodel.TagID = SeperationCheckList.TagID; Exitmodel.RevisionID = SeperationCheckList.RevisionID; Exitmodel.RevisionNo = SeperationCheckList.RevisionNo; Exitmodel.Reason = SeperationCheckList.Reason; } List <ReasonDetail> Q_Questionnaire_Revision = dal.getReasonList(); Exitmodel.ReasonList = Q_Questionnaire_Revision; return(PartialView("_CheckListDetails", Exitmodel)); } catch { throw; } }
public ActionResult Index() { Session["SearchEmpFullName"] = null; // to hide emp search Session["SearchEmpCode"] = null; Session["SearchEmpID"] = null; ExitViewModel Exitmodel = new ExitViewModel(); string employeeCode = Membership.GetUser().UserName; string[] role = Roles.GetRolesForUser(employeeCode); Exitmodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); Exitmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); EmployeeDAL DAL = new EmployeeDAL(); Exitmodel.SearchedUserDetails.EmployeeId = DAL.GetEmployeeID(employeeCode); Exitmodel.SearchedUserDetails.EmployeeCode = employeeCode; return(View(Exitmodel)); }
public ActionResult EditReason(ExitViewModel model) { try { bool success = false; string result = null; ConfigurationDAL configDal = new ConfigurationDAL(); ExitViewModel returnModel = new ExitViewModel(); returnModel = configDal.SaveEditedReason(model); //if record does not exist if (returnModel.IsExisted == false) { if (returnModel.IsEdited == true) { success = true; result = "Edited"; } else { success = true; result = "Added"; } } else { success = true; result = "Exists"; } return(Json(new { resultReason = result, status = success }, JsonRequestBehavior.AllowGet)); } catch { throw; } }
public ActionResult EditCheckList(ExitViewModel model) { try { bool success = false; string result = null; ConfigurationDAL configDal = new ConfigurationDAL(); success = configDal.SaveEditedCheckList(model); if (success == true) { result = "Edited"; } else { result = "Error"; } return(Json(new { resultReason = result, status = success }, JsonRequestBehavior.AllowGet)); } catch { throw; } }