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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = ACCompanyInfoEntity.FLD_NAME_CompanyInfoID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                aCCompanyInfoEntityList = FCCACCompanyInfo.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(aCCompanyInfoEntityList ?? new List <ACCompanyInfoEntity>());
        }
Ejemplo n.º 2
0
        private void SaveACCompanyInfoEntity()
        {
            if (IsValid)
            {
                try
                {
                    ACCompanyInfoEntity aCCompanyInfoEntity = BuildACCompanyInfoEntity();

                    Int64 result = -1;

                    if (aCCompanyInfoEntity.IsNew)
                    {
                        result = FCCACCompanyInfo.GetFacadeCreate().Add(aCCompanyInfoEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ACCompanyInfoEntity.FLD_NAME_CompanyInfoID, aCCompanyInfoEntity.CompanyInfoID.ToString(), SQLMatchType.Equal);
                        result = FCCACCompanyInfo.GetFacadeCreate().Update(aCCompanyInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _CompanyInfoID       = 0;
                        _ACCompanyInfoEntity = new ACCompanyInfoEntity();
                        PrepareInitialView();
                        BindACCompanyInfoList();

                        if (aCCompanyInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "A CCompany Info Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "A CCompany Info Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (aCCompanyInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add A CCompany Info Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update A CCompany Info Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 3
0
        protected void lvACCompanyInfo_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 CompanyInfoID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(ACCompanyInfoEntity.FLD_NAME_CompanyInfoID, CompanyInfoID.ToString(), SQLMatchType.Equal);

                        ACCompanyInfoEntity aCCompanyInfoEntity = new ACCompanyInfoEntity();


                        result = FCCACCompanyInfo.GetFacadeCreate().Delete(aCCompanyInfoEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _CompanyInfoID       = 0;
                            _ACCompanyInfoEntity = new ACCompanyInfoEntity();
                            PrepareInitialView();
                            BindACCompanyInfoList();

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

            try
            {
                aCCompanyInfoEntityList = FCCACCompanyInfo.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(aCCompanyInfoEntityList ?? new List <ACCompanyInfoEntity>());
        }