Esempio n. 1
0
        //To check Role for Approve Reject head Count.
        //For CEO,COO and RPM is onle able to see the list
        public static Boolean CheckRolesApproveRejectHeadCount()
        {
            MRFRoles  mrfRoles        = new MRFRoles();
            ArrayList arrRolesForUser = GetAuthorizeUserRoles();
            Boolean   validUser       = false;

            if (arrRolesForUser.Count >= 1)
            {
                foreach (string STR in arrRolesForUser)
                {
                    switch (STR)
                    {
                    case AuthorizationManagerConstants.ROLECOO:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLERPM:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLECEO:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLECFM:
                        validUser = true;
                        return(validUser);

                    default:
                        break;
                    }
                }
            }
            return(validUser);
        }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            this.SetEmployeeIndex();
        }


        //for roles and login user id

        Rave.HR.BusinessLayer.MRF.MRFRoles mrfRoles = new Rave.HR.BusinessLayer.MRF.MRFRoles();
        // Get logged-in user's email id
        AuthorizationManager objRaveHRAuthorizationManager = new AuthorizationManager();

        UserRaveDomainId = objRaveHRAuthorizationManager.getLoggedInUser();
        UserMailId       = UserRaveDomainId.Replace("co.in", "com");
        AuthorizationManager RaveHRAuthorizationManager = new AuthorizationManager();

        //ArrayList arrRolesForUser = RaveHRAuthorizationManager.getRolesForUser(objRaveHRAuthorizationManager.getLoggedInUser());
        arrRolesForUser = RaveHRAuthorizationManager.getRolesForUser(objRaveHRAuthorizationManager.getLoggedInUser());

        if (arrRolesForUser.Contains(AuthorizationManagerConstants.ROLEHR))
        {
            trResignationDetails.Visible = true;
            trEmployeeResume.Visible     = true;
        }
        // 30212,30295-Ambar-03102011-made both the statement to upper case for checking
        else if (((BusinessEntities.Employee)(Session[SessionNames.EMPLOYEEDETAILS])).EmailId.ToString().ToUpper() == UserRaveDomainId.ToString().Replace("co.in", "com").ToUpper())
        {
            // 30212-Ambar-Start-03102011
            trResignationDetails.Visible = false;
            // 30212-Ambar-End-03102011
            trEmployeeResume.Visible = true;
        }
        else
        {
            //Ishwar 20022015 : NIS RMS : Start
            string strUserIdentity = string.Empty;
            strUserIdentity = HttpContext.Current.ApplicationInstance.Session["WindowsUsername"].ToString().Trim();
            BusinessEntities.Employee Employee = new BusinessEntities.Employee();
            Rave.HR.BusinessLayer.Employee.Employee employeeBL = new Rave.HR.BusinessLayer.Employee.Employee();
            Employee = employeeBL.GetNISEmployeeList(strUserIdentity);
            if (!String.IsNullOrEmpty(Employee.WindowsUserName))
            {
                trResignationDetails.Visible = true;
            }//Ishwar 20022015 : NIS RMS : End
            else
            {
                trResignationDetails.Visible = false;
                trEmployeeResume.Visible     = false;
            }
        }
    }
Esempio n. 3
0
        //To Get Role for Approve Reject head Count.
        //For CEO,COO and RPM is onle able to see the list
        //RPM=CEO+COO Authentication
        //RPM=CEO+RPM
        //RPM=COO+RPM
        //CEO=1;
        //COO=3
        public static string GetRolesApproveRejectHeadCount()
        {
            MRFRoles  mrfRoles        = new MRFRoles();
            ArrayList arrRolesForUser = GetAuthorizeUserRoles();
            int       validUser       = 2;

            if (arrRolesForUser.Count >= 1)
            {
                foreach (string STR in arrRolesForUser)
                {
                    switch (STR)
                    {
                    case AuthorizationManagerConstants.ROLECOO:
                        validUser++;
                        break;

                    case AuthorizationManagerConstants.ROLERPM:
                        return(AuthorizationManagerConstants.ROLERPM);

                    case AuthorizationManagerConstants.ROLECEO:
                        validUser--;
                        break;

                    default:
                        break;
                    }
                }
                if (validUser == 3)
                {
                    return(AuthorizationManagerConstants.ROLECOO);
                }
                else if (validUser == 2)
                {
                    return(AuthorizationManagerConstants.ROLERPM);
                }
                else if (validUser == 1)
                {
                    return(AuthorizationManagerConstants.ROLECEO);
                }
            }
            return(AuthorizationManagerConstants.ROLERPM);
        }
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //Clearing the error label
            lblMessage.Text    = string.Empty;
            lblConfirmMsg.Text = string.Empty;

            btnSave.Attributes.Add(Common.CommonConstants.EVENT_ONCLICK, "return ButtonClickValidate();");
            //26137-Ambar-Start
            //btnRollBack.Attributes.Add(Common.CommonConstants.EVENT_ONCLICK, "return ConfirmForRollBackResign();");
            //26137-Ambar-End
            //Poonam : Issue : Disable Button : Starts
            btnSave.OnClientClick     = "if(ButtonClickValidate()){" + ClientScript.GetPostBackEventReference(btnSave, null) + "}";
            btnRollBack.OnClientClick = "if(ConfirmForRollBackResign()){" + ClientScript.GetPostBackEventReference(btnRollBack, null) + "}";
            //Poonam : Issue : Disable Button : Ends
            //btnRMFM.Attributes.Add(CommonConstants.EVENT_ONCLICK, "return SelectProjectDetails();");

            Rave.HR.BusinessLayer.MRF.MRFRoles mrfRoles = new Rave.HR.BusinessLayer.MRF.MRFRoles();
            // Get logged-in user's email id
            AuthorizationManager objRaveHRAuthorizationManager = new AuthorizationManager();
            UserRaveDomainId = objRaveHRAuthorizationManager.getLoggedInUser();
            UserMailId       = UserRaveDomainId.Replace("co.in", "com");
            AuthorizationManager RaveHRAuthorizationManager = new AuthorizationManager();
            //ArrayList arrRolesForUser = RaveHRAuthorizationManager.getRolesForUser(objRaveHRAuthorizationManager.getLoggedInUser());
            arrRolesForUser = RaveHRAuthorizationManager.getRolesForUser(objRaveHRAuthorizationManager.getLoggedInUser());

            if (!ValidateURL())
            {
                Response.Redirect(CommonConstants.INVALIDURL, false);
            }

            if (Session[Common.SessionNames.EMPLOYEEDETAILS] != null)
            {
                employee = (BusinessEntities.Employee)Session[Common.SessionNames.EMPLOYEEDETAILS];
            }

            if (employee != null)
            {
                employeeID      = employee.EMPId;
                lblempName.Text = employee.FirstName.ToUpper() + " " + employee.LastName.ToUpper();
            }

            if (!IsPostBack)
            {
                #region Modified By Mohamed Dangra
                // Mohamed : Issue 50959 : 16/05/2014 : Starts
                // Desc : Roll back button should invisible for Inactive employee

                if (employee.StatusId == 142)
                {
                    //31145-Subhra-Start
                    if (employee.ResignationReason != string.Empty)
                    {
                        btnRollBack.Visible = true;
                    }
                    //31145-Subhra-end
                }

                // Mohamed : Issue 50959 : 16/05/2014 : Ends
                #endregion Modified By Mohamed Dangra
                this.GetEmployeeStatus();
                this.PopulateControls();

                //Ishwar 20022015 : NIS RMS : Start
                string strUserIdentity = string.Empty;
                strUserIdentity = HttpContext.Current.ApplicationInstance.Session["WindowsUsername"].ToString().Trim();
                BusinessEntities.Employee Employee = new BusinessEntities.Employee();
                Rave.HR.BusinessLayer.Employee.Employee employeeBL = new Rave.HR.BusinessLayer.Employee.Employee();
                Employee = employeeBL.GetNISEmployeeList(strUserIdentity);
                if (!String.IsNullOrEmpty(Employee.WindowsUserName))
                {
                    pnlResignationDetails.Enabled = false;
                    btnRMFMHTML.Visible           = false;
                    btnSave.Visible     = false;
                    btnRollBack.Visible = false;
                }
                //Ishwar 20022015 : NIS RMS : End
            }

            SavedControlVirtualPath = "~/EmployeeMenuUC.ascx";
            ReloadControl();
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "Page_Load", EventIDConstants.RAVE_HR_CONTRACT_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
Esempio n. 5
0
        //To check Role for Raise MRF.
        //For RPM,AM/GPM/APM,FM,CFM,Presales is onle able to see the list
        public static Boolean CheckRolesRaiseMrf()
        {
            MRFRoles  mrfRoles        = new MRFRoles();
            ArrayList arrRolesForUser = GetAuthorizeUserRoles();
            Boolean   validUser       = false;

            if (arrRolesForUser.Count >= 1)
            {
                foreach (string STR in arrRolesForUser)
                {
                    switch (STR)
                    {
                    case AuthorizationManagerConstants.ROLEPM:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLEGPM:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLEAPM:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLEFM:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLERPM:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLEPRESALES:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLECFM:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLERECRUITMENT:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLEHR:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLETESTING:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLEQUALITY:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLEMH:
                        validUser = true;
                        return(validUser);

                    case AuthorizationManagerConstants.ROLERAVECONSULTANT:
                        validUser = true;
                        return(validUser);

                    default:
                        break;
                    }
                }
            }
            return(validUser);
        }