public IList <HREmployeeEvaluationReportEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <HREmployeeEvaluationReportEntity> hREmployeeEvaluationReportEntityList = new List <HREmployeeEvaluationReportEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = HREmployeeEvaluationReportEntity.FLD_NAME_EmployeeEvaluationReportID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                hREmployeeEvaluationReportEntityList = FCCHREmployeeEvaluationReport.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(hREmployeeEvaluationReportEntityList ?? new List <HREmployeeEvaluationReportEntity>());
        }
Beispiel #2
0
        private void SaveHREmployeeEvaluationReportEntity()
        {
            if (IsValid)
            {
                try
                {
                    HREmployeeEvaluationReportEntity hREmployeeEvaluationReportEntity = BuildHREmployeeEvaluationReportEntity();

                    Int64 result = -1;

                    if (hREmployeeEvaluationReportEntity.IsNew)
                    {
                        result = FCCHREmployeeEvaluationReport.GetFacadeCreate().Add(hREmployeeEvaluationReportEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEvaluationReportEntity.FLD_NAME_EmployeeEvaluationReportID, hREmployeeEvaluationReportEntity.EmployeeEvaluationReportID.ToString(), SQLMatchType.Equal);
                        result = FCCHREmployeeEvaluationReport.GetFacadeCreate().Update(hREmployeeEvaluationReportEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EmployeeEvaluationReportID       = 0;
                        _HREmployeeEvaluationReportEntity = new HREmployeeEvaluationReportEntity();
                        PrepareInitialView();
                        PrepareEditView();
                        BindHREmployeeEvaluationReportList();

                        if (hREmployeeEvaluationReportEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Evaluation Report Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Evaluation Report Information has been updated successfully.", false);
                            //Response.Redirect("~/HR/HREmployeeEvaluation.aspx");
                        }
                    }
                    else
                    {
                        if (hREmployeeEvaluationReportEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Evaluation Report Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Evaluation Report Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Beispiel #3
0
        protected void lvHREmployeeEvaluationReport_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EmployeeEvaluationReportID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEvaluationReportEntity.FLD_NAME_EmployeeEvaluationReportID, EmployeeEvaluationReportID.ToString(), SQLMatchType.Equal);

                        HREmployeeEvaluationReportEntity hREmployeeEvaluationReportEntity = new HREmployeeEvaluationReportEntity();


                        result = FCCHREmployeeEvaluationReport.GetFacadeCreate().Delete(hREmployeeEvaluationReportEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EmployeeEvaluationReportID       = 0;
                            _HREmployeeEvaluationReportEntity = new HREmployeeEvaluationReportEntity();
                            PrepareInitialView();
                            BindHREmployeeEvaluationReportList();

                            MiscUtil.ShowMessage(lblMessage, "Employee Evaluation Report has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee Evaluation Report.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <HREmployeeEvaluationReportEntity> GetData()
        {
            IList <HREmployeeEvaluationReportEntity> hREmployeeEvaluationReportEntityList = new List <HREmployeeEvaluationReportEntity>();

            try
            {
                hREmployeeEvaluationReportEntityList = FCCHREmployeeEvaluationReport.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(hREmployeeEvaluationReportEntityList ?? new List <HREmployeeEvaluationReportEntity>());
        }