Ejemplo n.º 1
0
        public IList <CRMBuyerInterestedRoomMapEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <CRMBuyerInterestedRoomMapEntity> cRMBuyerInterestedRoomMapEntityList = new List <CRMBuyerInterestedRoomMapEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CRMBuyerInterestedRoomMapEntity.FLD_NAME_BuyerInterestedRoomMapID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cRMBuyerInterestedRoomMapEntityList = FCCCRMBuyerInterestedRoomMap.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cRMBuyerInterestedRoomMapEntityList ?? new List <CRMBuyerInterestedRoomMapEntity>());
        }
Ejemplo n.º 2
0
        private void SaveCRMBuyerInterestedRoomMapEntity()
        {
            if (IsValid)
            {
                try
                {
                    CRMBuyerInterestedRoomMapEntity cRMBuyerInterestedRoomMapEntity = BuildCRMBuyerInterestedRoomMapEntity();

                    Int64 result = -1;

                    if (cRMBuyerInterestedRoomMapEntity.IsNew)
                    {
                        result = FCCCRMBuyerInterestedRoomMap.GetFacadeCreate().Add(cRMBuyerInterestedRoomMapEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMBuyerInterestedRoomMapEntity.FLD_NAME_BuyerInterestedRoomMapID, cRMBuyerInterestedRoomMapEntity.BuyerInterestedRoomMapID.ToString(), SQLMatchType.Equal);
                        result = FCCCRMBuyerInterestedRoomMap.GetFacadeCreate().Update(cRMBuyerInterestedRoomMapEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _BuyerInterestedRoomMapID        = 0;
                        _CRMBuyerInterestedRoomMapEntity = new CRMBuyerInterestedRoomMapEntity();
                        PrepareInitialView();
                        BindCRMBuyerInterestedRoomMapList();

                        if (cRMBuyerInterestedRoomMapEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "C RMBuyer Interested Room Map Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "C RMBuyer Interested Room Map Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cRMBuyerInterestedRoomMapEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add C RMBuyer Interested Room Map Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update C RMBuyer Interested Room Map Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 3
0
        protected void lvCRMBuyerInterestedRoomMap_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 BuyerInterestedRoomMapID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CRMBuyerInterestedRoomMapEntity.FLD_NAME_BuyerInterestedRoomMapID, BuyerInterestedRoomMapID.ToString(), SQLMatchType.Equal);

                        CRMBuyerInterestedRoomMapEntity cRMBuyerInterestedRoomMapEntity = new CRMBuyerInterestedRoomMapEntity();


                        result = FCCCRMBuyerInterestedRoomMap.GetFacadeCreate().Delete(cRMBuyerInterestedRoomMapEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _BuyerInterestedRoomMapID        = 0;
                            _CRMBuyerInterestedRoomMapEntity = new CRMBuyerInterestedRoomMapEntity();
                            PrepareInitialView();
                            BindCRMBuyerInterestedRoomMapList();

                            MiscUtil.ShowMessage(lblMessage, "C RMBuyer Interested Room Map has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete C RMBuyer Interested Room Map.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public IList <CRMBuyerInterestedRoomMapEntity> GetData()
        {
            IList <CRMBuyerInterestedRoomMapEntity> cRMBuyerInterestedRoomMapEntityList = new List <CRMBuyerInterestedRoomMapEntity>();

            try
            {
                cRMBuyerInterestedRoomMapEntityList = FCCCRMBuyerInterestedRoomMap.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cRMBuyerInterestedRoomMapEntityList ?? new List <CRMBuyerInterestedRoomMapEntity>());
        }
Ejemplo n.º 5
0
        private void SaveCRMBuyerBasicInfoEntity()
        {
            if (IsValid)
            {
                try
                {
                    CRMBuyerBasicInfoEntity cRMBuyerBasicInfoEntity = BuildCRMBuyerBasicInfoEntity();

                    Int64 result = -1;

                    if (cRMBuyerBasicInfoEntity.IsNew)
                    {
                        result = FCCCRMBuyerBasicInfo.GetFacadeCreate().Add(cRMBuyerBasicInfoEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMBuyerBasicInfoEntity.FLD_NAME_BuyerBasicInfoID, cRMBuyerBasicInfoEntity.BuyerBasicInfoID.ToString(), SQLMatchType.Equal);
                        result = FCCCRMBuyerBasicInfo.GetFacadeCreate().Update(cRMBuyerBasicInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        #region Buyer Interested Room Map

                        try
                        {
                            IList <CRMBuyerInterestedRoomMapEntity> newMappedItems = new List <CRMBuyerInterestedRoomMapEntity>();

                            foreach (ListItem chbxItem in chbxBuyerInterestedRoom.Items)
                            {
                                if (chbxItem.Selected)
                                {
                                    CRMBuyerInterestedRoomMapEntity mDItemMapEntity = new CRMBuyerInterestedRoomMapEntity();
                                    mDItemMapEntity.BuyerBasicInfoID = result;
                                    mDItemMapEntity.BuyerInterestedRoomCategoryID = Int64.Parse(chbxItem.Value.ToString());
                                    newMappedItems.Add(mDItemMapEntity);
                                }
                            }

                            IList <CRMBuyerInterestedRoomMapEntity> deleteList = _CurrentCRMBuyerInterestedRoomMapEntityList.Except(newMappedItems, new CustomerComparer()).ToList();
                            IList <CRMBuyerInterestedRoomMapEntity> addNewList = newMappedItems.Except(_CurrentCRMBuyerInterestedRoomMapEntityList, new CustomerComparer()).ToList();

                            if (deleteList != null && deleteList.Count > 0)
                            {
                                foreach (CRMBuyerInterestedRoomMapEntity ent in deleteList)
                                {
                                    String fe1 = SqlExpressionBuilder.PrepareFilterExpression(CRMBuyerInterestedRoomMapEntity.FLD_NAME_BuyerBasicInfoID, ent.BuyerBasicInfoID.ToString(), SQLMatchType.Equal);
                                    String fe2 = SqlExpressionBuilder.PrepareFilterExpression(CRMBuyerInterestedRoomMapEntity.FLD_NAME_BuyerInterestedRoomCategoryID, ent.BuyerInterestedRoomCategoryID.ToString(), SQLMatchType.Equal);
                                    String fe  = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2);

                                    FCCCRMBuyerInterestedRoomMap.GetFacadeCreate().Delete(ent, fe, DatabaseOperationType.Delete, TransactionRequired.No);
                                }
                            }

                            if (addNewList != null && addNewList.Count > 0)
                            {
                                foreach (CRMBuyerInterestedRoomMapEntity ent in addNewList)
                                {
                                    FCCCRMBuyerInterestedRoomMap.GetFacadeCreate().Add(ent, DatabaseOperationType.Add, TransactionRequired.No);
                                }
                            }

                            //MiscUtil.ShowMessage(lblMessage, "Item Brand Map Information has been added successfully.", false);

                            if (Operation == "Communicate")
                            {
                                String navUrl = UrlHelper.BuildSecureUrl("~/CRM/CRMCommunication.aspx", string.Empty, "do", "Sales", UrlConstants.OVERVIEW_BUYER_BASIC_INFO_ID, result.ToString()).ToString();
                                Response.Redirect(navUrl);
                            }

                            else if (Operation == "none")
                            {
                                String navUrl = UrlHelper.BuildSecureUrl("~/CRM/CRMBuyerAllottee.aspx", string.Empty, UrlConstants.OVERVIEW_BUYER_BASIC_INFO_ID, result.ToString()).ToString();
                                Response.Redirect(navUrl);
                            }
                        }
                        catch (Exception ex)
                        {
                            MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                        }

                        #endregion

                        _BuyerBasicInfoID        = 0;
                        Operation                = "none";
                        _CRMBuyerBasicInfoEntity = new CRMBuyerBasicInfoEntity();
                        PrepareInitialView();
                        BindCRMBuyerBasicInfoList();
                        BindPRMItemBrandMapList();

                        if (cRMBuyerBasicInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Buyer Basic Info Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Buyer Basic Info Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cRMBuyerBasicInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Buyer Basic Info Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Buyer Basic Info Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 6
0
        private void PrepareEditView()
        {
            CRMBuyerBasicInfoEntity cRMBuyerBasicInfoEntity = CurrentCRMBuyerBasicInfoEntity;


            if (!cRMBuyerBasicInfoEntity.IsNew)
            {
                if (ddlBuyerTypeID.Items.Count > 0 && cRMBuyerBasicInfoEntity.BuyerTypeID != null)
                {
                    ddlBuyerTypeID.SelectedValue = cRMBuyerBasicInfoEntity.BuyerTypeID.ToString();
                }

                txtContactFullName.Text = cRMBuyerBasicInfoEntity.ContactFullName.ToString();
                txtCompanyName.Text     = cRMBuyerBasicInfoEntity.CompanyName.ToString();
                txtDesignation.Text     = cRMBuyerBasicInfoEntity.Designation.ToString();
                if (ddlInterestedProjectCategoryID.Items.Count > 0 && cRMBuyerBasicInfoEntity.InterestedProjectCategoryID != null)
                {
                    ddlInterestedProjectCategoryID.SelectedValue = cRMBuyerBasicInfoEntity.InterestedProjectCategoryID.ToString();
                }

                txtMobileNo.Text             = cRMBuyerBasicInfoEntity.MobileNo.ToString();
                txtMobileNo2.Text            = cRMBuyerBasicInfoEntity.MobileNo2.ToString();
                txtLandPhone.Text            = cRMBuyerBasicInfoEntity.LandPhone.ToString();
                txtLandPhoneOffice.Text      = cRMBuyerBasicInfoEntity.LandPhoneOffice.ToString();
                txtFaxNumber.Text            = cRMBuyerBasicInfoEntity.FaxNumber.ToString();
                txtPresentAddress.Text       = cRMBuyerBasicInfoEntity.PresentAddress.ToString();
                txtPresentAddressOffice.Text = cRMBuyerBasicInfoEntity.PresentAddressOffice.ToString();
                txtEmail.Text        = cRMBuyerBasicInfoEntity.Email.ToString();
                txtEmail2.Text       = cRMBuyerBasicInfoEntity.Email2.ToString();
                txtDOB.Text          = cRMBuyerBasicInfoEntity.DOB.ToStringDefault();
                txtNoOfChildren.Text = cRMBuyerBasicInfoEntity.NoOfChildren.ToString();
                if (ddlInterestedLandLocationID.Items.Count > 0 && cRMBuyerBasicInfoEntity.InterestedLandLocationID != null)
                {
                    ddlInterestedLandLocationID.SelectedValue = cRMBuyerBasicInfoEntity.InterestedLandLocationID.ToString();
                }

                if (ddlCityID.Items.Count > 0 && cRMBuyerBasicInfoEntity.CityID != null)
                {
                    ddlCityID.SelectedValue = cRMBuyerBasicInfoEntity.CityID.ToString();
                }

                txtAreaNeededFrom.Text = cRMBuyerBasicInfoEntity.AreaNeededFrom.ToString();
                txtAreaNeededTo.Text   = cRMBuyerBasicInfoEntity.AreaNeededTo.ToString();
                txtParkingNeeded.Text  = cRMBuyerBasicInfoEntity.ParkingNeeded.ToString();
                if (ddlAreaUnitID.Items.Count > 0 && cRMBuyerBasicInfoEntity.AreaUnitID != null)
                {
                    ddlAreaUnitID.SelectedValue = cRMBuyerBasicInfoEntity.AreaUnitID.ToString();
                }

                txtToiletNeeded.Text = cRMBuyerBasicInfoEntity.ToiletNeeded.ToString();
                txtUnitNeeded.Text   = cRMBuyerBasicInfoEntity.UnitNeeded.ToString();
                if (ddlAdvertiseWayID.Items.Count > 0 && cRMBuyerBasicInfoEntity.AdvertiseWayID != null)
                {
                    ddlAdvertiseWayID.SelectedValue = cRMBuyerBasicInfoEntity.AdvertiseWayID.ToString();
                }

                if (ddlLeadGeneratedByEmployeeID.Items.Count > 0 && cRMBuyerBasicInfoEntity.LeadGeneratedByEmployeeID != null)
                {
                    ddlLeadGeneratedByEmployeeID.SelectedValue = cRMBuyerBasicInfoEntity.LeadGeneratedByEmployeeID.ToString();
                }

                if (ddlLeadManagedByOneEmployeeID.Items.Count > 0 && cRMBuyerBasicInfoEntity.LeadManagedByOneEmployeeID != null)
                {
                    ddlLeadManagedByOneEmployeeID.SelectedValue = cRMBuyerBasicInfoEntity.LeadManagedByOneEmployeeID.ToString();
                }

                if (ddlLeadManagedByTwoEmployeeID.Items.Count > 0 && cRMBuyerBasicInfoEntity.LeadManagedByTwoEmployeeID != null)
                {
                    ddlLeadManagedByTwoEmployeeID.SelectedValue = cRMBuyerBasicInfoEntity.LeadManagedByTwoEmployeeID.ToString();
                }

                txtLeadConversionDate.Text = cRMBuyerBasicInfoEntity.LeadConversionDate.ToStringDefault();
                if (ddlProspectForProject.Items.Count > 0 && cRMBuyerBasicInfoEntity.ProspectForProject != null)
                {
                    ddlProspectForProject.SelectedValue = cRMBuyerBasicInfoEntity.ProspectForProject.ToString();
                }

                txtRemarks.Text = cRMBuyerBasicInfoEntity.Remarks.ToString();

                String feCurrent = SqlExpressionBuilder.PrepareFilterExpression(CRMBuyerInterestedRoomMapEntity.FLD_NAME_BuyerBasicInfoID, cRMBuyerBasicInfoEntity.BuyerBasicInfoID.ToString(), SQLMatchType.Equal);
                IList <CRMBuyerInterestedRoomMapEntity> ItemBrandList = FCCCRMBuyerInterestedRoomMap.GetFacadeCreate().GetIL(null, null, String.Empty, feCurrent, DatabaseOperationType.LoadWithFilterExpression);
                _CurrentCRMBuyerInterestedRoomMapEntityList = ItemBrandList;

                if (ItemBrandList != null && ItemBrandList.Count > 0)
                {
                    foreach (ListItem chbxItem in chbxBuyerInterestedRoom.Items)
                    {
                        var item = (from s in ItemBrandList
                                    where s.BuyerInterestedRoomCategoryID.ToString() == chbxItem.Value
                                    select s).FirstOrDefault();
                        if (item != null && item.BuyerInterestedRoomCategoryID > 0)
                        {
                            chbxItem.Selected = true;
                        }
                        else
                        {
                            chbxItem.Selected = false;
                        }
                    }
                }
                else
                {
                    foreach (ListItem chbxItem in chbxBuyerInterestedRoom.Items)
                    {
                        chbxItem.Selected = false;
                    }
                }


                btnSubmit.Text    = "Update";
                btnAddNew.Visible = true;
            }
        }