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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = HREmployeeAdditionalPaymentInfoEntity.FLD_NAME_EmployeeAdditonalPaymentInfoID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                hREmployeeAdditionalPaymentInfoEntityList = FCCHREmployeeAdditionalPaymentInfo.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(hREmployeeAdditionalPaymentInfoEntityList ?? new List <HREmployeeAdditionalPaymentInfoEntity>());
        }
Ejemplo n.º 2
0
        private void SaveHREmployeeAdditionalPaymentInfoEntity()
        {
            if (IsValid)
            {
                try
                {
                    HREmployeeAdditionalPaymentInfoEntity hREmployeeAdditionalPaymentInfoEntity = BuildHREmployeeAdditionalPaymentInfoEntity();

                    Int64 result = -1;

                    if (hREmployeeAdditionalPaymentInfoEntity.IsNew)
                    {
                        result = FCCHREmployeeAdditionalPaymentInfo.GetFacadeCreate().Add(hREmployeeAdditionalPaymentInfoEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeAdditionalPaymentInfoEntity.FLD_NAME_EmployeeAdditonalPaymentInfoID, hREmployeeAdditionalPaymentInfoEntity.EmployeeAdditonalPaymentInfoID.ToString(), SQLMatchType.Equal);
                        result = FCCHREmployeeAdditionalPaymentInfo.GetFacadeCreate().Update(hREmployeeAdditionalPaymentInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EmployeeAdditonalPaymentInfoID        = 0;
                        _HREmployeeAdditionalPaymentInfoEntity = new HREmployeeAdditionalPaymentInfoEntity();
                        PrepareInitialView();
                        BindHREmployeeAdditionalPaymentInfoList();

                        if (hREmployeeAdditionalPaymentInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Additional Payment Info Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Additional Payment Info Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (hREmployeeAdditionalPaymentInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Additional Payment Info Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Additional Payment Info Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 3
0
        protected void lvHREmployeeAdditionalPaymentInfo_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EmployeeAdditonalPaymentInfoID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeAdditionalPaymentInfoEntity.FLD_NAME_EmployeeAdditonalPaymentInfoID, EmployeeAdditonalPaymentInfoID.ToString(), SQLMatchType.Equal);

                        HREmployeeAdditionalPaymentInfoEntity hREmployeeAdditionalPaymentInfoEntity = new HREmployeeAdditionalPaymentInfoEntity();


                        result = FCCHREmployeeAdditionalPaymentInfo.GetFacadeCreate().Delete(hREmployeeAdditionalPaymentInfoEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EmployeeAdditonalPaymentInfoID        = 0;
                            _HREmployeeAdditionalPaymentInfoEntity = new HREmployeeAdditionalPaymentInfoEntity();
                            PrepareInitialView();
                            BindHREmployeeAdditionalPaymentInfoList();

                            MiscUtil.ShowMessage(lblMessage, "Employee Additional Payment Info has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee Additional Payment Info.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <HREmployeeAdditionalPaymentInfoEntity> GetData()
        {
            IList <HREmployeeAdditionalPaymentInfoEntity> hREmployeeAdditionalPaymentInfoEntityList = new List <HREmployeeAdditionalPaymentInfoEntity>();

            try
            {
                hREmployeeAdditionalPaymentInfoEntityList = FCCHREmployeeAdditionalPaymentInfo.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(hREmployeeAdditionalPaymentInfoEntityList ?? new List <HREmployeeAdditionalPaymentInfoEntity>());
        }