public ActionResult SelectStakeholder(string collection, string searchstring) { try { string roleIDWithcomma = collection.TrimEnd(','); string[] roleidArray = roleIDWithcomma.Split(','); int[] myInts = Array.ConvertAll(roleidArray, s => int.Parse(s)); StackHolderVM stackHoldermodel = new StackHolderVM(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); stackHoldermodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); stackHoldermodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL dal = new ConfigurationDAL(); List <StackHolderList> stackholder = dal.getSelectedStackHolder(myInts); if (searchstring != "") { List <StackHolderList> searchStakeHolder = stackholder.FindAll(x => x.Employee.ToLower().Replace(" ", "").Contains(searchstring.ToLower().Replace(" ", ""))); stackHoldermodel.stackHolder = searchStakeHolder; stackHoldermodel.CountRecord = searchStakeHolder.Count; } else { stackHoldermodel.stackHolder = stackholder; stackHoldermodel.CountRecord = stackholder.Count; } return(PartialView("_StakeHolder", stackHoldermodel)); } 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; } }
// Configure Separation Process Stackholder public ActionResult ConfigureSeparationStackholder() { try { StackHolderVM stackHoldermodel = new StackHolderVM(); string employeeCode = Membership.GetUser().UserName; string[] role = Roles.GetRolesForUser(employeeCode); stackHoldermodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); stackHoldermodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); EmployeeDAL employeeDAL = new EmployeeDAL(); stackHoldermodel.SearchedUserDetails.EmployeeId = employeeDAL.GetEmployeeID(employeeCode); stackHoldermodel.SearchedUserDetails.EmployeeCode = employeeCode; ConfigurationDAL dal = new ConfigurationDAL(); List <StackHolderList> stackHolder = dal.getStackHolderDetails(); stackHoldermodel.CountRecord = stackHolder.Count; stackHoldermodel.stackHolder = stackHolder; return(PartialView("_SeparationStackholder", stackHoldermodel)); } catch { throw; } }
// // GET: /Configuration/ public ActionResult Index() { try { ConfigurationViewModel configviewmodel = new ConfigurationViewModel(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); EmployeeDAL employeeDAL = new EmployeeDAL(); configviewmodel.SearchedUserDetails = new SearchedUserDetails(); ViewBag.AsciiKey = Session["SecurityKey"].ToString(); string employeeCode = Membership.GetUser().UserName; int employeeId = employeeDAL.GetEmployeeID(employeeCode); string[] role = Roles.GetRolesForUser(employeeCode); if (employeeCode != null) { configviewmodel.SearchedUserDetails.EmployeeId = employeeId; configviewmodel.SearchedUserDetails.EmployeeCode = employeeCode; configviewmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); } return(View(configviewmodel)); } catch (Exception) { throw; } }
public ActionResult AddRatingScales(int?RatingID) { try { AddRatingScale addNewRating = new AddRatingScale(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); addNewRating.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); addNewRating.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(Membership.GetUser().UserName); addNewRating.SearchedUserDetails.EmployeeId = employeeID; PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); addNewRating.SearchedUserDetails.EmployeeCode = personalDAL.getEmployeeCode(employeeID); ConfigurationDAL configDAL = new ConfigurationDAL(); if (RatingID != null) { tbl_PA_Rating_Master ratingScale = configDAL.getRatingScaleDetails(RatingID); addNewRating.Percentage = ratingScale.Percentage; addNewRating.Rating = ratingScale.Rating; addNewRating.RatingID = ratingScale.RatingID; addNewRating.Description = ratingScale.Description; addNewRating.AdjustmentFactor = ratingScale.AdjustmentFactor; addNewRating.SetAsMinimumLimit = ratingScale.SetAsMinimumLimit.HasValue ? ratingScale.SetAsMinimumLimit.Value : false; } return(PartialView("_addRatingScale", addNewRating)); } catch { throw; } }
public ActionResult ConfigureParameter() { try { Session["SearchEmpFullName"] = null; // to hide emp search Session["SearchEmpCode"] = null; Session["SearchEmpID"] = null; ConfirmationViewModel confirmationmodel = new ConfirmationViewModel(); string EmployeeCode = Membership.GetUser().UserName; string[] role = Roles.GetRolesForUser(EmployeeCode); confirmationmodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); confirmationmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); confirmationmodel.SearchedUserDetails.EmployeeCode = EmployeeCode; EmployeeDAL DAL = new EmployeeDAL(); confirmationmodel.SearchedUserDetails.EmployeeId = DAL.GetEmployeeID(EmployeeCode); ConfigurationDAL configDAL = new ConfigurationDAL(); List <CompetencyMaster> competencyMaster = configDAL.GetCompetencyMaster(); confirmationmodel.RecordsCount = competencyMaster.Count; confirmationmodel.CompetencyMasters = competencyMaster; return(PartialView("_ConfigureParameter", confirmationmodel)); } catch { throw; } }
public ActionResult ConfigureParametersRoles(string searchstring) { try { ConfigureParametersforRoles parameterRoles = new ConfigureParametersforRoles(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); parameterRoles.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); parameterRoles.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(Membership.GetUser().UserName); parameterRoles.SearchedUserDetails.EmployeeId = employeeID; parameterRoles.SearchedUserDetails.EmployeeCode = personalDAL.getEmployeeCode(employeeID); ConfigurationDAL configDAL = new ConfigurationDAL(); List <RoleLists> roleList = configDAL.getAllRoles(); if (searchstring != null) { List <RoleLists> roleListwithsearch = roleList.FindAll(x => x.RoleDescription.ToLower().Contains(searchstring.ToLower())); parameterRoles.RoleList = roleListwithsearch; parameterRoles.RecordsCount = roleList.Count; } else { parameterRoles.RoleList = roleList; parameterRoles.RecordsCount = roleList.Count; } return(PartialView("_ConfigureParameterRole", parameterRoles)); } catch { throw; } }
public ActionResult ConfigureParameterCategories() { try { ConfigureParameterCategory configParametercategory = new ConfigureParameterCategory(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); configParametercategory.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); configParametercategory.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(Membership.GetUser().UserName); configParametercategory.SearchedUserDetails.EmployeeId = employeeID; configParametercategory.SearchedUserDetails.EmployeeCode = personalDAL.getEmployeeCode(employeeID); ConfigurationDAL configDAL = new ConfigurationDAL(); List <Parametercompetency> parametercompetency = configDAL.GetParameterCategories(); configParametercategory.RecordsCount = parametercompetency.Count; configParametercategory.Parametercompetencys = parametercompetency; return(PartialView("_ConfigureParameterCompetency", configParametercategory)); } catch { throw; } }
public ActionResult AddParameterCompetency(int?categoryID) { try { AddNewCategory addnewcategory = new AddNewCategory(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); addnewcategory.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); addnewcategory.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(Membership.GetUser().UserName); addnewcategory.SearchedUserDetails.EmployeeId = employeeID; PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); addnewcategory.SearchedUserDetails.EmployeeCode = personalDAL.getEmployeeCode(employeeID); ConfigurationDAL configDAL = new ConfigurationDAL(); if (categoryID != null) { tbl_PA_CompetencyCategories parameterCategory = configDAL.getParametercategory(categoryID); addnewcategory.CategoryID = parameterCategory.CategoryID; addnewcategory.Category = parameterCategory.CategoryType; addnewcategory.Description = parameterCategory.CategoryDescription; } return(PartialView("_addParameterCategory", addnewcategory)); } catch { throw; } }
public ActionResult EditParameterRole(int RoleID) { try { Session["RoleID"] = RoleID; AssocieteDriverAndComepetency driverAndComeptency = new AssocieteDriverAndComepetency(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); driverAndComeptency.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); driverAndComeptency.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(Membership.GetUser().UserName); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); driverAndComeptency.SearchedUserDetails.EmployeeId = employeeID; driverAndComeptency.SearchedUserDetails.EmployeeCode = personalDAL.getEmployeeCode(employeeID); ConfigurationDAL configDAL = new ConfigurationDAL(); List <Competencies> competency = configDAL.getCompetenciesForRole(RoleID); driverAndComeptency.CompetencyList = competency; driverAndComeptency.RecordsCount = competency.Count; driverAndComeptency.RoleID = RoleID; return(PartialView("_CompetenciesForRole", driverAndComeptency)); } 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 AddRatingScales(AddRatingScale model) { try { bool success = false; string result = null; string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); CommonMethodsDAL Commondal = new CommonMethodsDAL(); string UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL configDAL = new ConfigurationDAL(); success = configDAL.SaveRatingScales(model, UserRole); if (model.IsAddnew) { result = "addnew"; return(Json(new { resultMesssage = result, status = success }, JsonRequestBehavior.AllowGet)); } else { if (success) { result = "Saved"; } else { result = "Error"; } return(Json(new { resultMesssage = result, status = success }, JsonRequestBehavior.AllowGet)); } } catch { throw; } }
public ActionResult Index() { try { Session["SearchEmpFullName"] = null; // to hide emp search Session["SearchEmpCode"] = null; Session["SearchEmpID"] = null; ConfirmationViewModel confirmationmodel = new ConfirmationViewModel(); string EmployeeCode = Membership.GetUser().UserName; string[] role = Roles.GetRolesForUser(EmployeeCode); confirmationmodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); confirmationmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); confirmationmodel.SearchedUserDetails.EmployeeCode = EmployeeCode; EmployeeDAL DAL = new EmployeeDAL(); confirmationmodel.SearchedUserDetails.EmployeeId = DAL.GetEmployeeID(EmployeeCode); return(View(confirmationmodel)); } catch { throw; } }
public ActionResult AddParameter(int?orderID) { addParameter addparameter = new addParameter(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); addparameter.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); addparameter.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); addparameter.SearchedUserDetails.EmployeeCode = Membership.GetUser().UserName; EmployeeDAL DAL = new EmployeeDAL(); addparameter.SearchedUserDetails.EmployeeId = DAL.GetEmployeeID(Membership.GetUser().UserName); ConfigurationDAL configDAL = new ConfigurationDAL(); if (orderID != null) { tbl_PA_Competency_Master competencyMaster = configDAL.getParameter(orderID); addparameter.Parameter = competencyMaster.Competency; addparameter.OrderNo = competencyMaster.OrderNo; addparameter.category = Convert.ToString(competencyMaster.CategoryID); addparameter.BehavioralIndicators = competencyMaster.BehavioralIndicators; addparameter.Description = competencyMaster.Description; addparameter.CompetencyID = competencyMaster.CompetencyID; } addparameter.CategoryList = configDAL.getCategoryList(); return(PartialView("_addParameter", addparameter)); }
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; } }
public ActionResult FeedbackChecklist(int OrderNumber) { exitFeedbackChecklistVM checklistModel = new exitFeedbackChecklistVM(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); checklistModel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); checklistModel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL dal = new ConfigurationDAL(); if (OrderNumber != 0) { List <FeedbackChk> feedbackChk = dal.getFeedbackChklist(OrderNumber); checklistModel.feedbackChk = feedbackChk; checklistModel.CountRecord = feedbackChk.Count; foreach (var item in feedbackChk) { checklistModel.Checklist = item.Checklist; checklistModel.Name = item.Name; checklistModel.Role = item.Role; checklistModel.HiddenChecklistID = item.Checklist; checklistModel.HiddenNameID = item.EmployeeID; } } checklistModel.StageID = OrderNumber; checklistModel.checkListFor = dal.getChecklistDetails(); ViewBag.checkListFor = dal.getChecklistDetails(); List <CheckListNames> checkList = dal.getcheckListNames(); checklistModel.checkListNames = checkList; return(PartialView("_ExitFeedbackChkList", checklistModel)); }
public ActionResult Index(string errorCode) { try { ErrorViewModel errormodel = new ErrorViewModel(); errormodel.SearchedUserDetails = new SearchedUserDetails(); string employeeCode = Membership.GetUser().UserName; EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(employeeCode); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); CommonMethodsDAL Commondal = new CommonMethodsDAL(); errormodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); if (employeeCode != null) { CommonMethodsDAL common = new CommonMethodsDAL(); errormodel.SearchedUserDetails.EmployeeId = employeeID; errormodel.SearchedUserDetails.EmployeeCode = employeeCode; } ViewBag.ErrorCode = errorCode; log.Error(errorCode); return(View(errormodel)); } catch (Exception ex) { log.Error(ex.ToString(), ex); return(RedirectToAction("LogOn", "Account")); } }
public ActionResult SelectNewCompetency(string CompetencyID, string searchstring) { try { int RoleID = (int)Session["RoleID"]; AssocieteDriverAndComepetency selectCompetency = new AssocieteDriverAndComepetency(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); selectCompetency.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); selectCompetency.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL configDAL = new ConfigurationDAL(); List <Competencies> NewSelectCompetency = new List <Competencies>(); if (CompetencyID != "") { string CompetencyIDWithcomma = CompetencyID.TrimEnd(','); string[] CompetencyIDArray = CompetencyIDWithcomma.Split(','); int[] myInts = Array.ConvertAll(CompetencyIDArray, s => int.Parse(s)); NewSelectCompetency = configDAL.getNewSelectCompetency(myInts, RoleID); } else { HRMSDBEntities dbContext = new HRMSDBEntities(); NewSelectCompetency = (from c in dbContext.tbl_PA_Competency_Master select new Competencies { OrderNo = c.OrderNo, CompetencyID = c.CompetencyID, Parameter = c.Competency, Description = c.Description, RoleID = RoleID, Checked = false }).Distinct().ToList(); } if (searchstring != "") { List <Competencies> competencyListwithsearch = NewSelectCompetency.FindAll(x => x.Parameter.ToLower().Contains(searchstring.ToLower())); selectCompetency.CompetencyList = competencyListwithsearch; selectCompetency.RecordsCount = competencyListwithsearch.Count; } else { selectCompetency.CompetencyList = NewSelectCompetency; selectCompetency.RecordsCount = NewSelectCompetency.Count; } return(PartialView("_SelectCompetencies", selectCompetency)); } catch { throw; } }
public static string Decrypt(string id, out bool isAuthorize) { try { CommonMethodsDAL Commondal = new CommonMethodsDAL(); string decryptedEmployeeId = string.Empty; decryptedEmployeeId = Commondal.Decrypt(Convert.ToString(id), true); decryptedEmployeeId = decryptedEmployeeId.Replace(HttpContext.Current.Session["SecurityKey"].ToString(), ""); isAuthorize = true; return(decryptedEmployeeId); } catch (System.Exception ex) { isAuthorize = false; return(string.Empty); } }
public ActionResult ShowSelectedStakeholder(string collection) { try { StackHolderVM stackHoldermodel = new StackHolderVM(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); stackHoldermodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); stackHoldermodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL dal = new ConfigurationDAL(); if (collection != "") { string roleIDWithcomma = collection.TrimEnd(','); string[] roleidArray = roleIDWithcomma.Split(','); int[] myInts = Array.ConvertAll(roleidArray, s => int.Parse(s)); List <StackHolderList> stackholder = dal.getSelectedStackHolder(myInts); List <StackHolderList> stackholderSelected = new List <StackHolderList>(); foreach (var item in stackholder) { if (myInts.Any(emp => emp == item.EmployeeID)) { stackholderSelected.Add(item); } else { continue; } } stackHoldermodel.stackHolder = stackholderSelected; stackHoldermodel.CountRecord = stackholderSelected.Count; } else { List <StackHolderList> stackholder = new List <StackHolderList>(); } ViewBag.IsShowButtonHide = true; return(PartialView("_StakeHolder", stackHoldermodel)); } catch { throw; } }
public ActionResult LoadExitFeedbackCheckListGrid(int OrderNumber, int page, int rows) { try { ConfigurationDAL dal = new ConfigurationDAL(); exitFeedbackChecklistVM checklistModel = new exitFeedbackChecklistVM(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); checklistModel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); checklistModel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); if (OrderNumber != 0) { List <FeedbackChk> feedbackChk = dal.getFeedbackChklistData(OrderNumber); checklistModel.feedbackChk = feedbackChk; checklistModel.CountRecord = feedbackChk.Count; foreach (var item in feedbackChk) { checklistModel.Checklist = item.Checklist; checklistModel.ChecklistName = item.ChecklistName; checklistModel.Name = item.Name; checklistModel.Role = item.Role; } } checklistModel.StageID = OrderNumber; checklistModel.checkListFor = dal.getChecklistDetails(); ViewBag.checkListFor = dal.getChecklistDetails(); List <CheckListNames> checkList = dal.getcheckListNames(); checklistModel.checkListNames = checkList; var jsonData = new { rows = checklistModel.feedbackChk, }; return(Json(jsonData)); } catch (Exception) { return(RedirectToAction("Index", "Error", new { errorCode = "There are some errors" })); } }
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 static string GetIssueDetails(string helpdeskid, string projectid, string hdnreportedbyEmpid) { // instantiate a serializer JavaScriptSerializer TheSerializer = new JavaScriptSerializer(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); ArrayList list = new ArrayList(); list.Add(helpdeskid); list.Add(projectid); list.Add(hdnreportedbyEmpid); ArrayList list1 = new ArrayList(); foreach (string value in list) { list1.Add(Commondal.Encrypt(Convert.ToString(value), true)); } var TheJson = TheSerializer.Serialize(list1); return(TheJson); }
public ActionResult SelectRoles(string roleID) { try { int competencyID = (int)Session["competencyID"]; ApplicableRolesViewModel applicablerole = new ApplicableRolesViewModel(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); applicablerole.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); applicablerole.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL configDAL = new ConfigurationDAL(); List <ApplicableRole> NewSelectRole = new List <ApplicableRole>(); if (roleID != "") { string roleIDWithcomma = roleID.TrimEnd(','); string[] roleidArray = roleIDWithcomma.Split(','); int[] myInts = Array.ConvertAll(roleidArray, s => int.Parse(s)); NewSelectRole = configDAL.getNewSelectRole(myInts, competencyID); } else { HRMSDBEntities dbContext = new HRMSDBEntities(); NewSelectRole = (from e in dbContext.HRMS_tbl_PM_Role orderby e.RoleDescription ascending select new ApplicableRole { CompetencyID = competencyID, RoleID = e.RoleID, Role = e.RoleDescription }).ToList(); } applicablerole.ApplicableRoles = NewSelectRole; return(PartialView("_SelectRoles", applicablerole)); } catch { throw; } }
public ActionResult ConfigureRatingScales() { ConfigureRatingScales configratingSale = new ConfigureRatingScales(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); configratingSale.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); configratingSale.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); EmployeeDAL dal = new EmployeeDAL(); int employeeID = dal.GetEmployeeID(Membership.GetUser().UserName); configratingSale.SearchedUserDetails.EmployeeId = employeeID; configratingSale.SearchedUserDetails.EmployeeCode = personalDAL.getEmployeeCode(employeeID); ConfigurationDAL configDAL = new ConfigurationDAL(); List <RatingScales> ratingScale = configDAL.GetRatingScales(); configratingSale.RecordsCount = ratingScale.Count; configratingSale.RatingScale = ratingScale; return(PartialView("_ConfigureRatingScales", configratingSale)); }
public static string GetUpdateCurrentAllocation(string helpdeskid, string projectid, string projectrole, string workhours, string fromdate, string enddate, string hdnreportedbyEmpid) { // instantiate a serializer JavaScriptSerializer TheSerializer = new JavaScriptSerializer(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); ArrayList list = new ArrayList(); list.Add(helpdeskid); list.Add(projectid); list.Add(projectrole); list.Add(workhours); list.Add(fromdate); list.Add(enddate); list.Add(hdnreportedbyEmpid); ArrayList list1 = new ArrayList(); foreach (string value in list) { list1.Add(Commondal.Encrypt(Convert.ToString(value), true)); } var TheJson = TheSerializer.Serialize(list1); return(TheJson); }
//Set Separation Stage Approvers public ActionResult SetSeparationStageApprovers() { try { SeparationChecklist Separationmodel = new SeparationChecklist(); string employeeCode = Membership.GetUser().UserName; string[] role = Roles.GetRolesForUser(employeeCode); Separationmodel.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); Separationmodel.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); PersonalDetailsDAL personalDAL = new PersonalDetailsDAL(); EmployeeDAL employeeDAL = new EmployeeDAL(); Separationmodel.SearchedUserDetails.EmployeeId = employeeDAL.GetEmployeeID(employeeCode); Separationmodel.SearchedUserDetails.EmployeeCode = employeeCode; ConfigurationDAL dal = new ConfigurationDAL(); List <SeperationChecklistRecord> seperationChecklist = dal.getSeperationChecklist(); Separationmodel.seperationChecklist = seperationChecklist; return(PartialView("_SetSeparationStageApproversDetails", Separationmodel)); } catch { throw; } }
public ActionResult ApplicableRoles(int?competencyID) { try { Session["competencyID"] = competencyID; var sessionCompetencyID = (int)Session["competencyID"]; ApplicableRolesViewModel applicablerole = new ApplicableRolesViewModel(); string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); applicablerole.SearchedUserDetails = new SearchedUserDetails(); CommonMethodsDAL Commondal = new CommonMethodsDAL(); applicablerole.SearchedUserDetails.UserRole = Commondal.GetMaxRoleForUser(role); ConfigurationDAL configDAL = new ConfigurationDAL(); if (competencyID != null) { List <ApplicableRole> competencyRoleApplicability = configDAL.getApplicableRoles(competencyID); applicablerole.ApplicableRoles = competencyRoleApplicability; } return(PartialView("_ApplicableRoles", applicablerole)); } catch { throw; } }
public static bool RecordAlredayExist(int Id, string Name, string ColumnId, string ColumnName, string TableName) { return(CommonMethodsDAL.RecordAlredayExist(Id, Name, ColumnId, ColumnName, TableName)); }
public ActionResult LogOn(LogOnModel model, string returnUrl) { if (ModelState.IsValid) { model.UserName = model.UserName.Trim(); if (Membership.ValidateUser(model.UserName, model.Password)) { FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe); if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/") && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\")) { return(Redirect(returnUrl)); } else { string[] role = Roles.GetRolesForUser(model.UserName); if (role == null || role.Count() <= 0) { FormsAuthentication.SignOut(); return(RedirectToAction("Index", "Error", new { errorCode = "Error403" })); } EmployeeDAL employeeDAL = new EmployeeDAL(); SemDAL SEMdal = new SemDAL(); int employeeID = employeeDAL.GetEmployeeID(model.UserName); int semEmployeeId = SEMdal.geteEmployeeIDFromSEMDatabase(model.UserName); Guid globalID = Guid.NewGuid(); Session["LoggedInEmployee"] = model.UserName; Session["LoggedInEmployeeSEMID"] = semEmployeeId; Session["SecurityKey"] = globalID.ToString(); string encryptedEmployeeid = Encrypt(Convert.ToString(Session["SecurityKey"].ToString() + employeeID), true); Session["encryptedLoggedinEmployeeID"] = encryptedEmployeeid; string current_DU = employeeDAL.getCurrentDU(model.UserName); Session["Current_DU"] = current_DU; Session["ViewNode"] = employeeDAL.GetViewableNodesForEmployee(Convert.ToInt32(model.UserName)); CommonMethodsDAL Commondal = new CommonMethodsDAL(); string maxRole = Commondal.GetMaxRoleForUser(role); Session["MaxUserRole"] = maxRole; //for Help desk Tab Access //if (User.IsInRole("Super Admin") == false) // Session // return RedirectToAction("Index", "PersonalDetails", new { employeeId = encryptedEmployeeid }); //return RedirectToAction("Index", "Orbit"); if (HttpContext.User.IsInRole("Super Admin")) { Session["SuperAdmin"] = model.UserName; } else { Session["SuperAdmin"] = 0; } Session["EmployeeID"] = model.UserName; HRMS_tbl_PM_Employee employee = employeeDAL.GetEmployeeDetailsByEmployeeCode(model.UserName); Session["LoggedInEmployeeName"] = employee.EmployeeName; if (employee != null) { Session["UserName"] = employee.FirstName; } //added code for access mapping Session["AccessRights"] = employeeDAL.GetPageAccessMapping(model.UserName); XmlDocument doc = new XmlDocument(); string data = employeeDAL.GetPageAccessMapping_xmlData(model.UserName); doc.LoadXml(data); Session["MenuDataList"] = JsonConvert.SerializeXmlNode(doc, Newtonsoft.Json.Formatting.None, true); return(RedirectPermanent("~/Orbitweb/SignInSignOut.aspx")); } } else { ModelState.AddModelError("", "The user name or password provided is incorrect."); } } // If we got this far, something failed, redisplay form return(View(model)); }