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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDSalaryTaxTypeEntity.FLD_NAME_SalaryTaxTypeID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDSalaryTaxTypeEntityList = FCCMDSalaryTaxType.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDSalaryTaxTypeEntityList ?? new List <MDSalaryTaxTypeEntity>());
        }
Ejemplo n.º 2
0
        private void SaveMDSalaryTaxTypeEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDSalaryTaxTypeEntity mDSalaryTaxTypeEntity = BuildMDSalaryTaxTypeEntity();

                    Int64 result = -1;

                    if (mDSalaryTaxTypeEntity.IsNew)
                    {
                        result = FCCMDSalaryTaxType.GetFacadeCreate().Add(mDSalaryTaxTypeEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDSalaryTaxTypeEntity.FLD_NAME_SalaryTaxTypeID, mDSalaryTaxTypeEntity.SalaryTaxTypeID.ToString(), SQLMatchType.Equal);
                        result = FCCMDSalaryTaxType.GetFacadeCreate().Update(mDSalaryTaxTypeEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _SalaryTaxTypeID       = 0;
                        _MDSalaryTaxTypeEntity = new MDSalaryTaxTypeEntity();
                        PrepareInitialView();
                        BindMDSalaryTaxTypeList();

                        if (mDSalaryTaxTypeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Salary Tax Type Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Salary Tax Type Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDSalaryTaxTypeEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Salary Tax Type Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Salary Tax Type Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 3
0
        protected void lvMDSalaryTaxType_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 SalaryTaxTypeID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDSalaryTaxTypeEntity.FLD_NAME_SalaryTaxTypeID, SalaryTaxTypeID.ToString(), SQLMatchType.Equal);

                        MDSalaryTaxTypeEntity mDSalaryTaxTypeEntity = new MDSalaryTaxTypeEntity();


                        result = FCCMDSalaryTaxType.GetFacadeCreate().Delete(mDSalaryTaxTypeEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _SalaryTaxTypeID       = 0;
                            _MDSalaryTaxTypeEntity = new MDSalaryTaxTypeEntity();
                            PrepareInitialView();
                            BindMDSalaryTaxTypeList();

                            MiscUtil.ShowMessage(lblMessage, "Salary Tax Type has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Salary Tax Type.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <MDSalaryTaxTypeEntity> GetData()
        {
            IList <MDSalaryTaxTypeEntity> mDSalaryTaxTypeEntityList = new List <MDSalaryTaxTypeEntity>();

            try
            {
                mDSalaryTaxTypeEntityList = FCCMDSalaryTaxType.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDSalaryTaxTypeEntityList ?? new List <MDSalaryTaxTypeEntity>());
        }