Esempio n. 1
0
        public IList <BDProjectFloorUnitEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <BDProjectFloorUnitEntity> bDProjectFloorUnitEntityList = new List <BDProjectFloorUnitEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = BDProjectFloorUnitEntity.FLD_NAME_ProjectFloorUnitID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                bDProjectFloorUnitEntityList = FCCBDProjectFloorUnit.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(bDProjectFloorUnitEntityList ?? new List <BDProjectFloorUnitEntity>());
        }
Esempio n. 2
0
        private void SaveBDProjectFloorUnitEntity()
        {
            if (IsValid)
            {
                try
                {
                    BDProjectFloorUnitEntity bDProjectFloorUnitEntity = BuildBDProjectFloorUnitEntity();

                    Int64 result = -1;

                    if (bDProjectFloorUnitEntity.IsNew)
                    {
                        result = FCCBDProjectFloorUnit.GetFacadeCreate().Add(bDProjectFloorUnitEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(BDProjectFloorUnitEntity.FLD_NAME_ProjectFloorUnitID, bDProjectFloorUnitEntity.ProjectFloorUnitID.ToString(), SQLMatchType.Equal);
                        result = FCCBDProjectFloorUnit.GetFacadeCreate().Update(bDProjectFloorUnitEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ProjectFloorUnitID       = 0;
                        _BDProjectFloorUnitEntity = new BDProjectFloorUnitEntity();
                        PrepareInitialView();
                        BindBDProjectFloorUnitList();
                        BindBDProjectFloorUnitFloorwiseList();

                        if (bDProjectFloorUnitEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Floor Unit Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Floor Unit Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (bDProjectFloorUnitEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Project Floor Unit Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Project Floor Unit Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Esempio n. 3
0
        protected void lvBDProjectFloorUnit_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ProjectFloorUnitID;

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

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

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(BDProjectFloorUnitEntity.FLD_NAME_ProjectFloorUnitID, ProjectFloorUnitID.ToString(), SQLMatchType.Equal);

                        BDProjectFloorUnitEntity bDProjectFloorUnitEntity = new BDProjectFloorUnitEntity();


                        result = FCCBDProjectFloorUnit.GetFacadeCreate().Delete(bDProjectFloorUnitEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ProjectFloorUnitID       = 0;
                            _BDProjectFloorUnitEntity = new BDProjectFloorUnitEntity();
                            PrepareInitialView();
                            BindBDProjectFloorUnitList();
                            BindBDProjectFloorUnitFloorwiseList();

                            MiscUtil.ShowMessage(lblMessage, "Project Floor Unit has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Project Floor Unit.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Esempio n. 4
0
        public IList <BDProjectFloorUnitEntity> GetData()
        {
            IList <BDProjectFloorUnitEntity> bDProjectFloorUnitEntityList = new List <BDProjectFloorUnitEntity>();

            try
            {
                bDProjectFloorUnitEntityList = FCCBDProjectFloorUnit.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(bDProjectFloorUnitEntityList ?? new List <BDProjectFloorUnitEntity>());
        }
        private void SaveCRMBuyerBookSpaceEntity()
        {
            if (IsValid)
            {
                try
                {
                    CRMBuyerBookSpaceEntity cRMBuyerBookSpaceEntity = BuildCRMBuyerBookSpaceEntity();

                    Int64 result = -1;

                    if (cRMBuyerBookSpaceEntity.IsNew)
                    {
                        result = FCCCRMBuyerBookSpace.GetFacadeCreate().Add(cRMBuyerBookSpaceEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMBuyerBookSpaceEntity.FLD_NAME_BuyerBookSpaceID, cRMBuyerBookSpaceEntity.BuyerBookSpaceID.ToString(), SQLMatchType.Equal);
                        result = FCCCRMBuyerBookSpace.GetFacadeCreate().Update(cRMBuyerBookSpaceEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        #region Project Floor Unit Update Info

                        BDProjectFloorUnitEntity bDProjectFloorUnitEntity = FCCBDProjectFloorUnit.GetFacadeCreate().GetByID(cRMBuyerBookSpaceEntity.ProjectFloorUnitID);
                        bDProjectFloorUnitEntity.ProjectFloorUnitStatusID = MasterDataConstants.MDProjectFloorUnitStatus.ALLOCATED;

                        String fe_floorUnit = SqlExpressionBuilder.PrepareFilterExpression(BDProjectFloorUnitEntity.FLD_NAME_ProjectFloorUnitID, cRMBuyerBookSpaceEntity.ProjectFloorUnitID.ToString(), SQLMatchType.Equal);

                        FCCBDProjectFloorUnit.GetFacadeCreate().Update(bDProjectFloorUnitEntity, fe_floorUnit, DatabaseOperationType.Update, TransactionRequired.No);

                        #endregion

                        PrepareLabel(false);
                        _BuyerBookSpaceID        = 0;
                        _CRMBuyerBookSpaceEntity = new CRMBuyerBookSpaceEntity();
                        PrepareInitialView();
                        BindCRMBuyerBookSpaceList();

                        if (cRMBuyerBookSpaceEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Buyer Book Space Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Buyer Book Space Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cRMBuyerBookSpaceEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Buyer Book Space Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Buyer Book Space Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }