Exemple #1
0
        public IList <HREmployeeEvaluationEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <HREmployeeEvaluationEntity> hREmployeeEvaluationEntityList = new List <HREmployeeEvaluationEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = HREmployeeEvaluationEntity.FLD_NAME_EmployeeEvaluationID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                hREmployeeEvaluationEntityList = FCCHREmployeeEvaluation.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(hREmployeeEvaluationEntityList ?? new List <HREmployeeEvaluationEntity>());
        }
        private void SaveHREmployeeEvaluationEntity()
        {
            if (IsValid)
            {
                try
                {
                    HREmployeeEvaluationEntity hREmployeeEvaluationEntity = BuildHREmployeeEvaluationEntity();

                    Int64 result = -1;

                    if (hREmployeeEvaluationEntity.IsNew)
                    {
                        result = FCCHREmployeeEvaluation.GetFacadeCreate().Add(hREmployeeEvaluationEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEvaluationEntity.FLD_NAME_EmployeeEvaluationID, hREmployeeEvaluationEntity.EmployeeEvaluationID.ToString(), SQLMatchType.Equal);
                        result = FCCHREmployeeEvaluation.GetFacadeCreate().Update(hREmployeeEvaluationEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EmployeeEvaluationID       = 0;
                        _HREmployeeEvaluationEntity = new HREmployeeEvaluationEntity();
                        PrepareInitialView();
                        BindHREmployeeEvaluationList();

                        if (hREmployeeEvaluationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Evaluation Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Evaluation Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (hREmployeeEvaluationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Evaluation Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Evaluation Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        private void SubmitButtonEnable()
        {
            if (Action == "Supervisor")
            {
                String fe1 = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEvaluationEntity.FLD_NAME_SessionID, _CurrentSessionID.ToString(), SQLMatchType.Equal);
                String fe2 = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEvaluationEntity.FLD_NAME_SupervisorEmployeeID, _SupervisorEmployeeID.ToString(), SQLMatchType.Equal);
                String fe3 = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEvaluationEntity.FLD_NAME_EmployeeID, _CurrentEmployeeEvaluatedID.ToString(), SQLMatchType.Equal);
                String fe  = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2);
                fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe3);

                IList <HREmployeeEvaluationEntity> lst = FCCHREmployeeEvaluation.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                if (lst != null && lst.Count > 0)
                {
                    if (lst[0].SupervisorSubmitDate.HasValue)
                    {
                        btnSubmit.Visible   = false;
                        lblFormLock.Visible = true;
                        SubmittedAction     = "Locked";
                    }
                    else
                    {
                        // btnSubmit.Visible = true;
                        lblFormLock.Visible = false;
                        SubmittedAction     = "UnLocked";
                    }
                }
            }
            else if (Action == "Employee")
            {
                String fe1 = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEvaluationEntity.FLD_NAME_SessionID, _CurrentSessionID.ToString(), SQLMatchType.Equal);
                String fe2 = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEvaluationEntity.FLD_NAME_EmployeeID, _CurrentEmployeeEvaluatedID.ToString(), SQLMatchType.Equal);
                String fe  = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2);

                IList <HREmployeeEvaluationEntity> lst = FCCHREmployeeEvaluation.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                if (lst != null && lst.Count > 0)
                {
                    if (lst[0].EmployeeSubmitDate.HasValue)
                    {
                        btnSubmit.Visible   = false;
                        lblFormLock.Visible = true;
                        SubmittedAction     = "Locked";
                    }
                    else
                    {
                        // btnSubmit.Visible = true;
                        lblFormLock.Visible = false;
                        SubmittedAction     = "UnLocked";
                    }
                }
            }
        }
        protected void lvHREmployeeEvaluation_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EmployeeEvaluationID;

            Int64.TryParse(e.CommandArgument.ToString(), out EmployeeEvaluationID);

            if (EmployeeEvaluationID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _EmployeeEvaluationID = EmployeeEvaluationID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEvaluationEntity.FLD_NAME_EmployeeEvaluationID, EmployeeEvaluationID.ToString(), SQLMatchType.Equal);

                        HREmployeeEvaluationEntity hREmployeeEvaluationEntity = new HREmployeeEvaluationEntity();


                        result = FCCHREmployeeEvaluation.GetFacadeCreate().Delete(hREmployeeEvaluationEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EmployeeEvaluationID       = 0;
                            _HREmployeeEvaluationEntity = new HREmployeeEvaluationEntity();
                            PrepareInitialView();
                            BindHREmployeeEvaluationList();

                            MiscUtil.ShowMessage(lblMessage, "Employee Evaluation has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee Evaluation.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //String fe1 = SqlExpressionBuilder.PrepareFilterExpression("HREmployeeEvaluation.EmployeeID", MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember).ToString(), SQLMatchType.Equal);
            //String fe2 = SqlExpressionBuilder.PrepareFilterExpression("HRSession.SessionID", "1", 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.cou


            // UpdateEvaluationInfo();

            if (_EmployeeEvaluationID > 0)
            {
                HREmployeeEvaluationEntity hREmployeeEvaluationEntity = FCCHREmployeeEvaluation.GetFacadeCreate().GetByID(_EmployeeEvaluationID);

                if (Action == "Supervisor")
                {
                    hREmployeeEvaluationEntity.SupervisorSubmitDate = System.DateTime.Now;
                }
                if (Action == "Employee")
                {
                    hREmployeeEvaluationEntity.EmployeeSubmitDate = System.DateTime.Now;
                }

                Int64 result = -1;

                String fe_update = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEvaluationEntity.FLD_NAME_EmployeeEvaluationID, _EmployeeEvaluationID.ToString(), SQLMatchType.Equal);
                result = FCCHREmployeeEvaluation.GetFacadeCreate().Update(hREmployeeEvaluationEntity, fe_update, DatabaseOperationType.Update, TransactionRequired.No);

                if (result > 0)
                {
                    MiscUtil.ShowMessage(lblMessage, "Submitted Successfully.", false);
                    SubmitButtonEnable();
                }

                else
                {
                    MiscUtil.ShowMessage(lblMessage, "Some Error Occoured.", false);
                }
            }
        }
Exemple #6
0
        public IList <HREmployeeEvaluationEntity> GetData()
        {
            IList <HREmployeeEvaluationEntity> hREmployeeEvaluationEntityList = new List <HREmployeeEvaluationEntity>();

            try
            {
                hREmployeeEvaluationEntityList = FCCHREmployeeEvaluation.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(hREmployeeEvaluationEntityList ?? new List <HREmployeeEvaluationEntity>());
        }
Exemple #7
0
        protected void lvHRSession_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataItem = (ListViewDataItem)e.Item;

                HRSession_DetailedEntity ent = (HRSession_DetailedEntity)dataItem.DataItem;

                String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEvaluationEntity.FLD_NAME_SessionID, ent.SessionID.ToString(), SQLMatchType.Equal);
                IList <HREmployeeEvaluationEntity> lst = FCCHREmployeeEvaluation.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                LinkButton lnkbtnGenerateSession = (LinkButton)e.Item.FindControl("lnkbtnGenerateSession");
                HyperLink  hypHRReport           = (HyperLink)e.Item.FindControl("hypHRReport");

                hypHRReport.Visible = false;
                if (lst != null && lst.Count > 0)
                {
                    lnkbtnGenerateSession.Visible = false;
                }

                if (ent.EvaluationSessionStatusID != MasterDataConstants.MDEvaluationSessionStatus.OPEN)
                {
                    lnkbtnGenerateSession.Visible = false;
                }

                #region SupervisorSubmited or not

                if (ent.SessionCategoryID == MasterDataConstants.MDEvaluationSessionCategory.PBR && (CurrentMember.MemberID == 25 || CurrentMember.MemberID == 182 || CurrentMember.MemberID == 317 || CurrentMember.MemberID == 20520 || CurrentMember.MemberID == 27 || CurrentMember.MemberID == 181))
                {
                    hypHRReport.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.HR_EMPLOYEE_EVALUATIONREPORT_REPORT_FOR_ALL_EMPLOYEE, UrlConstants.OVERVIEW_EVALUATION_SESSION_ID, ent.SessionID.ToString()).ToString();
                    hypHRReport.Visible     = true;
                    hypHRReport.Target      = "_blank";
                }

                #endregion
            }
        }