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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = ACAccountStatusEntity.FLD_NAME_AccountStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                aCAccountStatusEntityList = FCCACAccountStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(aCAccountStatusEntityList ?? new List <ACAccountStatusEntity>());
        }
Пример #2
0
        private void SaveACAccountStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    ACAccountStatusEntity aCAccountStatusEntity = BuildACAccountStatusEntity();

                    Int64 result = -1;

                    if (aCAccountStatusEntity.IsNew)
                    {
                        result = FCCACAccountStatus.GetFacadeCreate().Add(aCAccountStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ACAccountStatusEntity.FLD_NAME_AccountStatusID, aCAccountStatusEntity.AccountStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCACAccountStatus.GetFacadeCreate().Update(aCAccountStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _AccountStatusID       = 0;
                        _ACAccountStatusEntity = new ACAccountStatusEntity();
                        PrepareInitialView();
                        BindACAccountStatusList();

                        if (aCAccountStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "A CAccount Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "A CAccount Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (aCAccountStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add A CAccount Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update A CAccount Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Пример #3
0
        protected void lvACAccountStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 AccountStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(ACAccountStatusEntity.FLD_NAME_AccountStatusID, AccountStatusID.ToString(), SQLMatchType.Equal);

                        ACAccountStatusEntity aCAccountStatusEntity = new ACAccountStatusEntity();


                        result = FCCACAccountStatus.GetFacadeCreate().Delete(aCAccountStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _AccountStatusID       = 0;
                            _ACAccountStatusEntity = new ACAccountStatusEntity();
                            PrepareInitialView();
                            BindACAccountStatusList();

                            MiscUtil.ShowMessage(lblMessage, "A CAccount Status has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete A CAccount Status.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <ACAccountStatusEntity> GetData()
        {
            IList <ACAccountStatusEntity> aCAccountStatusEntityList = new List <ACAccountStatusEntity>();

            try
            {
                aCAccountStatusEntityList = FCCACAccountStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(aCAccountStatusEntityList ?? new List <ACAccountStatusEntity>());
        }