示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                divSuccess.Visible = false;

                getEmp_from_QueryString_or_currentUser();

                intended_Emp = Emp_DAL.get_Emp_Info(strEmpDisplayName);
                bind_Emp_Info();

                if (!IsPostBack)
                {
                    Active_Rate_Goals_Year = EnableYear_DAL.read_Active_Rate_Goals_Year();

                    #region Bind Objectives Year

                    lblActiveYear.Text = Active_Rate_Goals_Year;

                    #endregion Bind Objectives Year

                    getPreviouslySavedObjectives();

                    Bind_Data_To_Controls();
                }
            });
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                if (!IsPostBack)
                {
                    Active_Set_Goals_Year = EnableYear_DAL.get_Active_Set_Goals_Year();

                    #region Identify to-be-evaluated-user, Get his informatiion , and Bind it

                    strEmpDisplayName = getEmp_from_QueryString_or_currentUser();

                    intended_Emp = Emp_DAL.get_Emp_Info(strEmpDisplayName);
                    bind_Emp_Info();

                    #endregion Identify to-be-evaluated-user, Get his informatiion , and Bind it

                    tblObjectives = SetObjectives_DAL.getPreviouslySavedObjectives(strEmpDisplayName, Active_Set_Goals_Year).GetDataTable();

                    #region Check goals status and make ReadOnly mode

                    if (tblObjectives.Rows.Count > 0)
                    {
                        string currunt_status     = tblObjectives.Rows[0]["Status"].ToString();
                        string currunt_user_email = SPContext.Current.Web.CurrentUser.Email;
                        if (currunt_status == "Objectives_set_by_Emp" && currunt_user_email == intended_Emp.DM_email)
                        {
                            Show_Approve_Reject_Controls();
                        }
                        else if (currunt_status == "Objectives_approved_by_DM" && currunt_user_email == intended_Emp.Dept_Head_email)
                        {
                            Show_Approve_Reject_Controls();
                        }
                        else
                        {
                            Make_Read_Only_Mode();
                        }
                    }

                    #endregion Check goals status and make ReadOnly mode

                    Refresh_Objectives_grid();
                }
            });
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SPSecurity.RunWithElevatedPrivileges(delegate()
                {
                    divSuccess.Visible = false;

                    #region Check for year to use

                    Active_Rate_Goals_Year = EnableYear_DAL.read_Active_Rate_Goals_Year();
                    if (Active_Rate_Goals_Year == "NoRateGoalsActiveYear")
                    {
                        Active_Rate_Goals_Year = read_Year_to_display_if_none_active();
                    }
                    lblActiveYear.Text = Active_Rate_Goals_Year;

                    #endregion Check for year to use

                    #region Check for Emp to use (QueryString or current logged-in user)

                    if (Request.QueryString["empid"] != null)
                    {
                        strEmpDisplayName = Request.QueryString["empid"].ToString();
                    }
                    else
                    {
                        strEmpDisplayName = SPContext.Current.Web.CurrentUser.Name;             //"Test spuser_1"; //"sherif abdellatif";
                    }

                    intended_Emp = Emp_DAL.get_Emp_Info(strEmpDisplayName);
                    bind_Emp_Info();

                    #endregion Check for Emp to use (QueryString or current logged-in user)

                    if (Request.QueryString["mode"] != null && Request.QueryString["mode"] == "hr")
                    {
                        btnHRApprove.Visible = true;
                        btnSubmit.Visible    = false;
                    }

                    if (!IsPostBack)
                    {
                        ReadOnly_Mode = false;

                        #region Check current WorkFlow Status And current logged-in user To decide if ReadOnly_Mode

                        tblObjectives = SetObjectives_DAL.getPreviouslySavedObjectives(strEmpDisplayName, Active_Rate_Goals_Year).GetDataTable();

                        #region If no Objectives found, display a warning regarding that and stop proceeding
                        if (tblObjectives == null || tblObjectives.Rows.Count == 0)
                        {
                            Make_NoObjectivesFound_Mode();
                            return;
                        }
                        #endregion

                        string st = tblObjectives.Rows[0]["Status"].ToString().Trim().ToLower();
                        string p1 = WF_States.Objectives_ProgressSet_by_Emp.ToString().Trim().ToLower();
                        string p2 = WF_States.ObjsAndSkills_Rated.ToString().Trim().ToLower();
                        string p3 = WF_States.ApprovedBy_HRCommittee.ToString().Trim().ToLower();

                        if (st == p1 || st == p2 || st == p3)
                        {
                            lblProgressNotSet_Warning.Visible = false;
                        }
                        else
                        {
                            lblProgressNotSet_Warning.Visible = true;
                        }

                        if (st == p2 || st == p3)
                        {
                            ReadOnly_Mode = true;
                        }
                        else if (strEmpDisplayName == SPContext.Current.Web.CurrentUser.Name)
                        {
                            ReadOnly_Mode = true;
                        }

                        #endregion Check current WorkFlow Status And current logged-in user To decide if ReadOnly_Mode

                        #region Data Binding To UI Controls

                        txtNote1.Text   = SetObjectives_DAL.getPreviouslySavedNote1(strEmpDisplayName, Active_Rate_Goals_Year);
                        EvalNotes notes = SetObjectives_DAL.getPreviouslySavedEvalNotes(strEmpDisplayName, Active_Rate_Goals_Year);
                        txtNote_ReasonForRating1or5.Text = notes.ReasonForRating1or5;
                        txtNote_RecommendedCourses.Text  = notes.RecommendedCourses;

                        if (!Check_If_Emp_and_Year_saved_before())
                        {
                            getStandardSkills();
                        }

                        Bind_Data_To_Controls();

                        #endregion Data Binding To UI Controls
                    }

                    if (ReadOnly_Mode == true)
                    {
                        Make_ReadOnly_Mode();
                    }
                });
            }
            catch (Exception ex)
            {
                Send_Exception_Email(ex.Message);
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                if (!IsPostBack)
                {
                    Active_Set_Goals_Year = EnableYear_DAL.get_Active_Set_Goals_Year();

                    #region Check if setting goals period is closed, and if true, make ReadOnly mode

                    if (Active_Set_Goals_Year == "NoSetGoalsActiveYear")
                    {
                        Active_Set_Goals_Year = SetObjectives_DAL.get_Year_to_display_if_none_active();
                        Make_Read_Only_Mode();
                    }

                    #endregion Check if setting goals period is closed, and if true, make ReadOnly mode

                    #region Bind Objectives Year

                    lblActiveYear.Text = Active_Set_Goals_Year;

                    #endregion Bind Objectives Year

                    #region Identify Current User , get his informatiion , and Bind it

                    strEmpDisplayName = getEmp_from_QueryString_or_currentUser();

                    intended_Emp = Emp_DAL.get_Emp_Info(strEmpDisplayName);

                    bind_Emp_Info();

                    if (intended_Emp.EmpHierLvl == "4")
                    {
                        Set_Blank_Mode_For_High_Managerial_Levels();
                        return;
                    }

                    #endregion Identify Current User , get his informatiion , and Bind it

                    Bind_DDLs();

                    tblObjectives = SetObjectives_DAL.getPreviouslySavedObjectives(strEmpDisplayName, Active_Set_Goals_Year).GetDataTable();

                    #region Check if goals status is not "rejected" , make ReadOnly mode

                    if (tblObjectives.Rows.Count > 0)
                    {
                        string currunt_status = tblObjectives.Rows[0]["Status"].ToString();
                        if (currunt_status != "Objectives_rejected_by_DM" && currunt_status != "Objectives_rejected_by_Dept_Head")
                        {
                            Make_Read_Only_Mode();
                        }
                    }

                    #endregion Check if goals status is not "rejected" , make ReadOnly mode

                    Refresh_Objectives_grid();
                }
            });
        }