예제 #1
0
        public IList <ACItemGroupAccountMapEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <ACItemGroupAccountMapEntity> aCItemGroupAccountMapEntityList = new List <ACItemGroupAccountMapEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = ACItemGroupAccountMapEntity.FLD_NAME_ItemGroupAccountMapID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                aCItemGroupAccountMapEntityList = FCCACItemGroupAccountMap.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(aCItemGroupAccountMapEntityList ?? new List <ACItemGroupAccountMapEntity>());
        }
        private void SaveACItemGroupAccountMapEntity()
        {
            if (IsValid)
            {
                try
                {
                    ACItemGroupAccountMapEntity aCItemGroupAccountMapEntity = BuildACItemGroupAccountMapEntity();

                    Int64 result = -1;

                    if (aCItemGroupAccountMapEntity.IsNew)
                    {
                        result = FCCACItemGroupAccountMap.GetFacadeCreate().Add(aCItemGroupAccountMapEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ACItemGroupAccountMapEntity.FLD_NAME_ItemGroupAccountMapID, aCItemGroupAccountMapEntity.ItemGroupAccountMapID.ToString(), SQLMatchType.Equal);
                        result = FCCACItemGroupAccountMap.GetFacadeCreate().Update(aCItemGroupAccountMapEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ItemGroupAccountMapID       = 0;
                        _ACItemGroupAccountMapEntity = new ACItemGroupAccountMapEntity();
                        PrepareInitialView();
                        BindACItemGroupAccountMapList();

                        if (aCItemGroupAccountMapEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "A CItem Group Account Map Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "A CItem Group Account Map Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (aCItemGroupAccountMapEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add A CItem Group Account Map Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update A CItem Group Account Map Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvACItemGroupAccountMap_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ItemGroupAccountMapID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(ACItemGroupAccountMapEntity.FLD_NAME_ItemGroupAccountMapID, ItemGroupAccountMapID.ToString(), SQLMatchType.Equal);

                        ACItemGroupAccountMapEntity aCItemGroupAccountMapEntity = new ACItemGroupAccountMapEntity();


                        result = FCCACItemGroupAccountMap.GetFacadeCreate().Delete(aCItemGroupAccountMapEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ItemGroupAccountMapID       = 0;
                            _ACItemGroupAccountMapEntity = new ACItemGroupAccountMapEntity();
                            PrepareInitialView();
                            BindACItemGroupAccountMapList();

                            MiscUtil.ShowMessage(lblMessage, "A CItem Group Account Map has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete A CItem Group Account Map.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
예제 #4
0
        public IList <ACItemGroupAccountMapEntity> GetData()
        {
            IList <ACItemGroupAccountMapEntity> aCItemGroupAccountMapEntityList = new List <ACItemGroupAccountMapEntity>();

            try
            {
                aCItemGroupAccountMapEntityList = FCCACItemGroupAccountMap.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(aCItemGroupAccountMapEntityList ?? new List <ACItemGroupAccountMapEntity>());
        }