Beispiel #1
0
        public IList <ACMDPayToEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <ACMDPayToEntity> aCMDPayToEntityList = new List <ACMDPayToEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = ACMDPayToEntity.FLD_NAME_PayToID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                aCMDPayToEntityList = FCCACMDPayTo.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(aCMDPayToEntityList ?? new List <ACMDPayToEntity>());
        }
        private void SaveACMDPayToEntity()
        {
            if (IsValid)
            {
                try
                {
                    ACMDPayToEntity aCMDPayToEntity = BuildACMDPayToEntity();

                    Int64 result = -1;

                    if (aCMDPayToEntity.IsNew)
                    {
                        result = FCCACMDPayTo.GetFacadeCreate().Add(aCMDPayToEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ACMDPayToEntity.FLD_NAME_PayToID, aCMDPayToEntity.PayToID.ToString(), SQLMatchType.Equal);
                        result = FCCACMDPayTo.GetFacadeCreate().Update(aCMDPayToEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _PayToID         = 0;
                        _ACMDPayToEntity = new ACMDPayToEntity();
                        PrepareInitialView();
                        BindACMDPayToList();

                        if (aCMDPayToEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "A CPay To Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "A CPay To Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (aCMDPayToEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add A CPay To Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update A CPay To Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvACMDPayTo_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 PayToID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(ACMDPayToEntity.FLD_NAME_PayToID, PayToID.ToString(), SQLMatchType.Equal);

                        ACMDPayToEntity aCMDPayToEntity = new ACMDPayToEntity();


                        result = FCCACMDPayTo.GetFacadeCreate().Delete(aCMDPayToEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _PayToID         = 0;
                            _ACMDPayToEntity = new ACMDPayToEntity();
                            PrepareInitialView();
                            BindACMDPayToList();

                            MiscUtil.ShowMessage(lblMessage, "A CPay To has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete A CPay To.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Beispiel #4
0
        public IList <ACMDPayToEntity> GetData()
        {
            IList <ACMDPayToEntity> aCMDPayToEntityList = new List <ACMDPayToEntity>();

            try
            {
                aCMDPayToEntityList = FCCACMDPayTo.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(aCMDPayToEntityList ?? new List <ACMDPayToEntity>());
        }