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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = ACAccountEntity.FLD_NAME_AccountID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                aCAccountEntityList = FCCACAccount.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(aCAccountEntityList ?? new List <ACAccountEntity>());
        }
Example #2
0
        private void SaveACAccountEntity()
        {
            if (IsValid)
            {
                try
                {
                    ACAccountEntity aCAccountEntity = BuildACAccountEntity();

                    Int64 result = -1;

                    if (aCAccountEntity.IsNew)
                    {
                        result = FCCACAccount.GetFacadeCreate().Add(aCAccountEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ACAccountEntity.FLD_NAME_AccountID, aCAccountEntity.AccountID.ToString(), SQLMatchType.Equal);
                        result = FCCACAccount.GetFacadeCreate().Update(aCAccountEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _AccountID       = 0;
                        _ACAccountEntity = new ACAccountEntity();
                        PrepareInitialView();
                        BindACAccountList();

                        if (aCAccountEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "A CAccount Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "A CAccount Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (aCAccountEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add A CAccount Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update A CAccount Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Example #3
0
        protected void lvACAccount_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 AccountID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(ACAccountEntity.FLD_NAME_AccountID, AccountID.ToString(), SQLMatchType.Equal);

                        ACAccountEntity aCAccountEntity = new ACAccountEntity();


                        result = FCCACAccount.GetFacadeCreate().Delete(aCAccountEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _AccountID       = 0;
                            _ACAccountEntity = new ACAccountEntity();
                            PrepareInitialView();
                            BindACAccountList();

                            MiscUtil.ShowMessage(lblMessage, "A CAccount has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete A CAccount.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        private void BuildTree()
        {
            this.Nodes.Clear();

            nodeList    = FCCACAccountGroup.GetFacadeCreate().GetIL(null, null, String.Empty, String.Empty, DatabaseOperationType.Load);
            accountList = FCCACAccount.GetFacadeCreate().GetIL(null, null, String.Empty, String.Empty, DatabaseOperationType.Load);

            TreeNode rootNode = new TreeNode();

            rootNode.Text         = "Accounts Tree";
            rootNode.Value        = "0";
            rootNode.SelectAction = TreeNodeSelectAction.SelectExpand;
            rootNode.Expanded     = true;

            LoadCategories(rootNode, null);

            this.Nodes.Add(rootNode);
        }
        public IList <ACAccountEntity> GetData()
        {
            IList <ACAccountEntity> aCAccountEntityList = new List <ACAccountEntity>();

            try
            {
                aCAccountEntityList = FCCACAccount.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(aCAccountEntityList ?? new List <ACAccountEntity>());
        }