Ejemplo n.º 1
0
        public IList <MDAccountPaybleStatementDetailCategoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDAccountPaybleStatementDetailCategoryEntity> mDAccountPaybleStatementDetailCategoryEntityList = new List <MDAccountPaybleStatementDetailCategoryEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDAccountPaybleStatementDetailCategoryEntity.FLD_NAME_AccountPaybleStatementDetailCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDAccountPaybleStatementDetailCategoryEntityList = FCCMDAccountPaybleStatementDetailCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDAccountPaybleStatementDetailCategoryEntityList ?? new List <MDAccountPaybleStatementDetailCategoryEntity>());
        }
Ejemplo n.º 2
0
        private void SaveMDAccountPaybleStatementDetailCategoryEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDAccountPaybleStatementDetailCategoryEntity mDAccountPaybleStatementDetailCategoryEntity = BuildMDAccountPaybleStatementDetailCategoryEntity();

                    Int64 result = -1;

                    if (mDAccountPaybleStatementDetailCategoryEntity.IsNew)
                    {
                        result = FCCMDAccountPaybleStatementDetailCategory.GetFacadeCreate().Add(mDAccountPaybleStatementDetailCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDAccountPaybleStatementDetailCategoryEntity.FLD_NAME_AccountPaybleStatementDetailCategoryID, mDAccountPaybleStatementDetailCategoryEntity.AccountPaybleStatementDetailCategoryID.ToString(), SQLMatchType.Equal);
                        result = FCCMDAccountPaybleStatementDetailCategory.GetFacadeCreate().Update(mDAccountPaybleStatementDetailCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _AccountPaybleStatementDetailCategoryID       = 0;
                        _MDAccountPaybleStatementDetailCategoryEntity = new MDAccountPaybleStatementDetailCategoryEntity();
                        PrepareInitialView();
                        BindMDAccountPaybleStatementDetailCategoryList();

                        if (mDAccountPaybleStatementDetailCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Account Payble Statement Detail Category Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Account Payble Statement Detail Category Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDAccountPaybleStatementDetailCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Account Payble Statement Detail Category Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Account Payble Statement Detail Category Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 3
0
        protected void lvMDAccountPaybleStatementDetailCategory_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 AccountPaybleStatementDetailCategoryID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDAccountPaybleStatementDetailCategoryEntity.FLD_NAME_AccountPaybleStatementDetailCategoryID, AccountPaybleStatementDetailCategoryID.ToString(), SQLMatchType.Equal);

                        MDAccountPaybleStatementDetailCategoryEntity mDAccountPaybleStatementDetailCategoryEntity = new MDAccountPaybleStatementDetailCategoryEntity();


                        result = FCCMDAccountPaybleStatementDetailCategory.GetFacadeCreate().Delete(mDAccountPaybleStatementDetailCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _AccountPaybleStatementDetailCategoryID       = 0;
                            _MDAccountPaybleStatementDetailCategoryEntity = new MDAccountPaybleStatementDetailCategoryEntity();
                            PrepareInitialView();
                            BindMDAccountPaybleStatementDetailCategoryList();

                            MiscUtil.ShowMessage(lblMessage, "Account Payble Statement Detail Category has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Account Payble Statement Detail Category.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public IList <MDAccountPaybleStatementDetailCategoryEntity> GetData()
        {
            IList <MDAccountPaybleStatementDetailCategoryEntity> mDAccountPaybleStatementDetailCategoryEntityList = new List <MDAccountPaybleStatementDetailCategoryEntity>();

            try
            {
                mDAccountPaybleStatementDetailCategoryEntityList = FCCMDAccountPaybleStatementDetailCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDAccountPaybleStatementDetailCategoryEntityList ?? new List <MDAccountPaybleStatementDetailCategoryEntity>());
        }