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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CRMMDBuyerInterestedRoomCategoryEntity.FLD_NAME_BuyerInterestedRoomCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cRMMDBuyerInterestedRoomCategoryEntityList = FCCCRMMDBuyerInterestedRoomCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cRMMDBuyerInterestedRoomCategoryEntityList ?? new List <CRMMDBuyerInterestedRoomCategoryEntity>());
        }
        private void SaveCRMMDBuyerInterestedRoomCategoryEntity()
        {
            if (IsValid)
            {
                try
                {
                    CRMMDBuyerInterestedRoomCategoryEntity cRMMDBuyerInterestedRoomCategoryEntity = BuildCRMMDBuyerInterestedRoomCategoryEntity();

                    Int64 result = -1;

                    if (cRMMDBuyerInterestedRoomCategoryEntity.IsNew)
                    {
                        result = FCCCRMMDBuyerInterestedRoomCategory.GetFacadeCreate().Add(cRMMDBuyerInterestedRoomCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMMDBuyerInterestedRoomCategoryEntity.FLD_NAME_BuyerInterestedRoomCategoryID, cRMMDBuyerInterestedRoomCategoryEntity.BuyerInterestedRoomCategoryID.ToString(), SQLMatchType.Equal);
                        result = FCCCRMMDBuyerInterestedRoomCategory.GetFacadeCreate().Update(cRMMDBuyerInterestedRoomCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _BuyerInterestedRoomCategoryID          = 0;
                        _CRMMDBuyerInterestedRoomCategoryEntity = new CRMMDBuyerInterestedRoomCategoryEntity();
                        PrepareInitialView();
                        BindCRMMDBuyerInterestedRoomCategoryList();

                        if (cRMMDBuyerInterestedRoomCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "C RMBuyer Interested Room Category Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "C RMBuyer Interested Room Category Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cRMMDBuyerInterestedRoomCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add C RMBuyer Interested Room Category Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update C RMBuyer Interested Room Category Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Пример #3
0
        private void BindPRMItemBrandMapList()
        {
            String se = SqlExpressionBuilder.PrepareSortExpression(CRMMDBuyerInterestedRoomCategoryEntity.FLD_NAME_Name, SQLSortOrderType.Assending);
            IList <CRMMDBuyerInterestedRoomCategoryEntity> buyerInterestedRoomList = FCCCRMMDBuyerInterestedRoomCategory.GetFacadeCreate().GetIL(null, null, se, String.Empty, DatabaseOperationType.LoadWithSortExpression);

            _CurrentCRMMDBuyerInterestedRoomCategoryList = buyerInterestedRoomList;
            chbxBuyerInterestedRoom.DataSource           = buyerInterestedRoomList;

            chbxBuyerInterestedRoom.DataTextField  = "Name";
            chbxBuyerInterestedRoom.DataValueField = "BuyerInterestedRoomCategoryID";
            chbxBuyerInterestedRoom.DataBind();
        }
        protected void lvCRMMDBuyerInterestedRoomCategory_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 BuyerInterestedRoomCategoryID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMMDBuyerInterestedRoomCategoryEntity.FLD_NAME_BuyerInterestedRoomCategoryID, BuyerInterestedRoomCategoryID.ToString(), SQLMatchType.Equal);

                        CRMMDBuyerInterestedRoomCategoryEntity cRMMDBuyerInterestedRoomCategoryEntity = new CRMMDBuyerInterestedRoomCategoryEntity();


                        result = FCCCRMMDBuyerInterestedRoomCategory.GetFacadeCreate().Delete(cRMMDBuyerInterestedRoomCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _BuyerInterestedRoomCategoryID          = 0;
                            _CRMMDBuyerInterestedRoomCategoryEntity = new CRMMDBuyerInterestedRoomCategoryEntity();
                            PrepareInitialView();
                            BindCRMMDBuyerInterestedRoomCategoryList();

                            MiscUtil.ShowMessage(lblMessage, "C RMBuyer Interested Room Category has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete C RMBuyer Interested Room Category.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <CRMMDBuyerInterestedRoomCategoryEntity> GetData()
        {
            IList <CRMMDBuyerInterestedRoomCategoryEntity> cRMMDBuyerInterestedRoomCategoryEntityList = new List <CRMMDBuyerInterestedRoomCategoryEntity>();

            try
            {
                cRMMDBuyerInterestedRoomCategoryEntityList = FCCCRMMDBuyerInterestedRoomCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cRMMDBuyerInterestedRoomCategoryEntityList ?? new List <CRMMDBuyerInterestedRoomCategoryEntity>());
        }