Exemplo n.º 1
0
        public IList <BDProjectLiftEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <BDProjectLiftEntity> bDProjectLiftEntityList = new List <BDProjectLiftEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = BDProjectLiftEntity.FLD_NAME_ProjectLiftID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                bDProjectLiftEntityList = FCCBDProjectLift.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(bDProjectLiftEntityList ?? new List <BDProjectLiftEntity>());
        }
Exemplo n.º 2
0
        private void SaveBDProjectLiftEntity()
        {
            if (IsValid)
            {
                try
                {
                    BDProjectLiftEntity bDProjectLiftEntity = BuildBDProjectLiftEntity();

                    Int64 result = -1;

                    if (bDProjectLiftEntity.IsNew)
                    {
                        result = FCCBDProjectLift.GetFacadeCreate().Add(bDProjectLiftEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(BDProjectLiftEntity.FLD_NAME_ProjectLiftID, bDProjectLiftEntity.ProjectLiftID.ToString(), SQLMatchType.Equal);
                        result = FCCBDProjectLift.GetFacadeCreate().Update(bDProjectLiftEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ProjectLiftID       = 0;
                        _BDProjectLiftEntity = new BDProjectLiftEntity();
                        PrepareInitialView();
                        PrepareEditView();
                        BindBDProjectLiftList();

                        if (bDProjectLiftEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Lift Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Lift Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (bDProjectLiftEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Project Lift Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Project Lift Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Exemplo n.º 3
0
        public IList <BDProjectLiftEntity> GetData()
        {
            IList <BDProjectLiftEntity> bDProjectLiftEntityList = new List <BDProjectLiftEntity>();

            try
            {
                bDProjectLiftEntityList = FCCBDProjectLift.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(bDProjectLiftEntityList ?? new List <BDProjectLiftEntity>());
        }