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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = BDProjectAddressInfoEntity.FLD_NAME_ProjectAddressInfoID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                bDProjectAddressInfoEntityList = FCCBDProjectAddressInfo.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(bDProjectAddressInfoEntityList ?? new List <BDProjectAddressInfoEntity>());
        }
Beispiel #2
0
        private void SaveBDProjectAddressInfoEntity()
        {
            if (IsValid)
            {
                try
                {
                    BDProjectAddressInfoEntity bDProjectAddressInfoEntity = BuildBDProjectAddressInfoEntity();

                    Int64 result = -1;

                    if (bDProjectAddressInfoEntity.IsNew)
                    {
                        result = FCCBDProjectAddressInfo.GetFacadeCreate().Add(bDProjectAddressInfoEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(BDProjectAddressInfoEntity.FLD_NAME_ProjectAddressInfoID, bDProjectAddressInfoEntity.ProjectAddressInfoID.ToString(), SQLMatchType.Equal);
                        result = FCCBDProjectAddressInfo.GetFacadeCreate().Update(bDProjectAddressInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ProjectAddressInfoID       = 0;
                        _BDProjectAddressInfoEntity = new BDProjectAddressInfoEntity();
                        PrepareInitialView();
                        BindBDProjectAddressInfoList();

                        if (bDProjectAddressInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Address Info Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Address Info Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (bDProjectAddressInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Project Address Info Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Project Address Info Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Beispiel #3
0
        protected void lvBDProjectAddressInfo_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ProjectAddressInfoID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(BDProjectAddressInfoEntity.FLD_NAME_ProjectAddressInfoID, ProjectAddressInfoID.ToString(), SQLMatchType.Equal);

                        BDProjectAddressInfoEntity bDProjectAddressInfoEntity = new BDProjectAddressInfoEntity();


                        result = FCCBDProjectAddressInfo.GetFacadeCreate().Delete(bDProjectAddressInfoEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ProjectAddressInfoID       = 0;
                            _BDProjectAddressInfoEntity = new BDProjectAddressInfoEntity();
                            PrepareInitialView();
                            BindBDProjectAddressInfoList();

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

            try
            {
                bDProjectAddressInfoEntityList = FCCBDProjectAddressInfo.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(bDProjectAddressInfoEntityList ?? new List <BDProjectAddressInfoEntity>());
        }