private void BindLabel()
        {
            String fe1 = SqlExpressionBuilder.PrepareFilterExpression("HREmployeeEvaluation.EmployeeID", _CurrentEmployeeEvaluatedID.ToString(), SQLMatchType.Equal);
            String fe2 = SqlExpressionBuilder.PrepareFilterExpression("HRSession.SessionID", _CurrentSessionID.ToString(), SQLMatchType.Equal);
            String fe3 = "HREmployeeEvaluationResult.EmployeeResult is not null";

            String fe = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2);

            //fe=SqlExpressionBuilder.PrepareFilterExpression(fe,SQLJoinType.AND,fe3);

            IList <HREmployeeEvaluationSession_CustomEntity> lst = FCCHREmployeeEvaluationSession_Custom.GetFacadeCreate().GetIL(10000, 1, String.Empty, fe);

            if (lst != null && lst.Count > 0)
            {
                var resultMyScore = (from s in lst
                                     select s.EmployeeResult).Sum(val => val);

                var resultSupervisor = (from s in lst
                                        select s.Result).Sum(val => val);

                lblMyMarks.Text         = resultMyScore.ToString();
                lblSupervisorMarks.Text = resultSupervisor.ToString();
            }
            else
            {
                lblMyMarks.Text         = "0";
                lblSupervisorMarks.Text = "0";
            }
        }
Beispiel #2
0
        public IList <HREmployeeEvaluationSession_CustomEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression, String filterExpression)
        {
            IList <HREmployeeEvaluationSession_CustomEntity> hREmployeeEvaluationSession_CustomEntityList = new List <HREmployeeEvaluationSession_CustomEntity>();

            try
            {
                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = "SessionID";
                }

                Int32 currentPage = Convert.ToInt32(startRowIndex / pageSize) + 1;
                //startRowIndex = Convert.ToInt32(  startRowIndex / pageSize) + 1;

                if (pageSize == -1)
                {
                    pageSize = 1000000000;
                }

                hREmployeeEvaluationSession_CustomEntityList = FCCHREmployeeEvaluationSession_Custom.GetFacadeCreate().GetIL(pageSize, currentPage, sortExpression, filterExpression);

                if (hREmployeeEvaluationSession_CustomEntityList != null && hREmployeeEvaluationSession_CustomEntityList.Count > 0)
                {
                    totalRowCount = hREmployeeEvaluationSession_CustomEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(hREmployeeEvaluationSession_CustomEntityList ?? new List <HREmployeeEvaluationSession_CustomEntity>());
        }
        protected void odsMDEvaluationCriteria_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            if (e.ExecutingSelectCount == false && e.Arguments.SortExpression == String.Empty)
            {
                UpdateEvaluationInfo();
            }

            String fe = String.Empty;

            String fe1 = SqlExpressionBuilder.PrepareFilterExpression("HREmployeeEvaluation.EmployeeID", _CurrentEmployeeEvaluatedID.ToString(), SQLMatchType.Equal);
            String fe2 = SqlExpressionBuilder.PrepareFilterExpression("HRSession.SessionID", _CurrentSessionID.ToString(), SQLMatchType.Equal);


            #region Submit Button

            if (Action == "Employee")
            {
                String fe11           = SqlExpressionBuilder.PrepareFilterExpression("HREmployeeEvaluation.EmployeeID", _CurrentEmployeeEvaluatedID.ToString(), SQLMatchType.Equal);
                String fe22           = SqlExpressionBuilder.PrepareFilterExpression("HRSession.SessionID", _CurrentSessionID.ToString(), SQLMatchType.Equal);
                String fe33           = "HREmployeeEvaluationResult.EmployeeResult is not null";
                String fe_employeenew = SqlExpressionBuilder.PrepareFilterExpression("MDEvaluationCriteria.SupervisorWillAnswer", "0".ToString(), SQLMatchType.Equal);

                String fefe = SqlExpressionBuilder.PrepareFilterExpression(fe11, SQLJoinType.AND, fe22);
                String fe4  = SqlExpressionBuilder.PrepareFilterExpression(fe_employeenew, SQLJoinType.AND, fe33);

                fefe = SqlExpressionBuilder.PrepareFilterExpression(fefe, SQLJoinType.AND, fe4);
                fe   = fe_employeenew;
                IList <HREmployeeEvaluationSession_CustomEntity> lst = FCCHREmployeeEvaluationSession_Custom.GetFacadeCreate().GetIL(10000, 1, String.Empty, fefe);

                if (lst != null && lst.Count > 0)
                {
                    if (lst[0].SessionCategoryID == MasterDataConstants.MDEvaluationSessionCategory.QUARTERLY_EVALUATIONS)
                    {
                        if (lst != null && lst.Count == 6)
                        {
                            btnSubmit.Visible = true;
                        }
                        if (lblFormLock.Visible == true)
                        {
                            btnSubmit.Visible = false;
                        }
                    }
                    else if (lst[0].SessionCategoryID == MasterDataConstants.MDEvaluationSessionCategory.HEALTH_CHECKUP)
                    {
                        if (lst != null && lst.Count == 32)
                        {
                            btnSubmit.Visible = true;
                        }
                        if (lblFormLock.Visible == true)
                        {
                            btnSubmit.Visible = false;
                        }
                    }
                    else if (lst[0].SessionCategoryID == MasterDataConstants.MDEvaluationSessionCategory.PBR)
                    {
                        if (lst != null && lst.Count == 5)
                        {
                            btnSubmit.Visible = true;
                        }
                        if (lblFormLock.Visible == true)
                        {
                            btnSubmit.Visible = false;
                        }
                    }
                }
            }

            if (Action == "Supervisor")
            {
                String fe11        = SqlExpressionBuilder.PrepareFilterExpression("HREmployeeEvaluation.SupervisorEmployeeID", _SupervisorEmployeeID.ToString(), SQLMatchType.Equal);
                String fe22        = SqlExpressionBuilder.PrepareFilterExpression("HRSession.SessionID", _CurrentSessionID.ToString(), SQLMatchType.Equal);
                String fe_employee = SqlExpressionBuilder.PrepareFilterExpression("HREmployeeEvaluation.EmployeeID", _CurrentEmployeeEvaluatedID.ToString(), SQLMatchType.Equal);
                String fe33        = "HREmployeeEvaluationResult.Result is not null";

                String fefe = SqlExpressionBuilder.PrepareFilterExpression(fe11, SQLJoinType.AND, fe22);
                String fe4  = SqlExpressionBuilder.PrepareFilterExpression(fe33, SQLJoinType.AND, fe_employee);
                fefe = SqlExpressionBuilder.PrepareFilterExpression(fefe, SQLJoinType.AND, fe4);

                IList <HREmployeeEvaluationSession_CustomEntity> lst = FCCHREmployeeEvaluationSession_Custom.GetFacadeCreate().GetIL(10000, 1, String.Empty, fefe);

                if (lst != null && lst.Count > 0)
                {
                    if (lst[0].SessionCategoryID == MasterDataConstants.MDEvaluationSessionCategory.QUARTERLY_EVALUATIONS)
                    {
                        if (lst.Count == 6)
                        {
                            btnSubmit.Visible = true;
                        }

                        if (lblFormLock.Visible == true)
                        {
                            btnSubmit.Visible = false;
                        }
                    }
                    else if (lst[0].SessionCategoryID == MasterDataConstants.MDEvaluationSessionCategory.HEALTH_CHECKUP)
                    {
                        if (lst != null && lst.Count < 32)
                        {
                            btnSubmit.Visible = true;
                        }
                        if (lblFormLock.Visible == true)
                        {
                            btnSubmit.Visible = false;
                        }
                    }
                    else if (lst[0].SessionCategoryID == MasterDataConstants.MDEvaluationSessionCategory.PBR)
                    {
                        if (lst != null && lst.Count == 5)
                        {
                            btnSubmit.Visible = true;
                        }
                        if (lblFormLock.Visible == true)
                        {
                            btnSubmit.Visible = false;
                        }
                    }
                }
            }

            #endregion

            fe = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2);

            if (Action == "Employee")
            {
                String fe_employeenew = SqlExpressionBuilder.PrepareFilterExpression("MDEvaluationCriteria.SupervisorWillAnswer", "0".ToString(), SQLMatchType.Equal);
                fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe_employeenew);
            }

            e.InputParameters["filterExpression"] = fe;
        }