public flcsRoomConvention(string id, int dealId)
        {
            this.id        = id;
            this.dealId    = dealId;
            packageHandler = new PackageGenerator.PackageHandler(false, ConfigurationManager.AppSettings["enviroment"].ToString());
            hotelContract  = packageHandler.GetHotelContractByRecno(Convert.ToInt32(id), dealId);
            queryHandler   = new GulliverLibrary.QueryHandler();
            InitializeComponent();

            //FillRoomTypes();
            //FillRoomGrades();
            //FillRoomViews();
        }
 public flcsRoomRequestSetting(string id, int dealId)
 {
     this.id        = id;
     this.dealId    = dealId;
     packageHandler = new PackageGenerator.PackageHandler(false, ConfigurationManager.AppSettings["enviroment"].ToString());
     hotelContract  = packageHandler.GetHotelContractByRecno(Convert.ToInt32(id), dealId);
     if (hotelContract != null)
     {
         roomRequestSetting = packageHandler.GetRoomRequestSettingByContractIdAndDeal(hotelContract.id, hotelContract.Deal.id);
     }
     else
     {
         roomRequestSetting = packageHandler.GetRoomRequestSettingByContractIdAndDeal(Convert.ToInt32(id), dealId);
     }
     InitializeComponent();
     FillRoomRequestSettings();
 }
Example #3
0
        private void SaveDealInformartion()
        {
            SetStepProgressBar(progressBar);
            List <GulliverLibrary.Link> links = new List <GulliverLibrary.Link>();

            using (GulliverLibrary.Link link = new GulliverLibrary.Link())
            {
                link.name = "YouTube Link";
                link.Deal = deal;
                link.url  = txtYouTubeLink.Text.Trim();
                if (link.url.Trim() != string.Empty)
                {
                    links.Add(link);
                }
            }

            deal.DealInformation.mainHeader = txtMainHeader.Text.Trim();
            deal.DealInformation.Deal       = deal;
            deal.DealInformation.subHeader  = txtSubHeader.Text.Trim();
            deal.DealInformation.longitude  = txtLongitude.Text.Trim();
            deal.DealInformation.latitude   = txtLatitude.Text.Trim();

            //deal.DealInformation.HotelInformation = gulliverQueryHandler.GetHotelInformationByGeoCodes(deal.DealInformation.longitude.Trim(), deal.DealInformation.latitude.Trim());


            using (GulliverLibrary.HotelInformation hotelInformation = new GulliverLibrary.HotelInformation())
            {
                hotelInformation.longitude         = txtLongitude.Text.Trim();
                hotelInformation.latitude          = txtLatitude.Text.Trim();
                hotelInformation.hotelHeader       = txtHotelTitle.Text.Trim();
                hotelInformation.hotelBodyText     = txtHotelText.Text.Trim();
                hotelInformation.destinationText   = txtDestinationText.Text.Trim();
                hotelInformation.countryText       = txtCountryText.Text.Trim();
                hotelInformation.accessibility     = txtAccessibilityText.Text;
                hotelInformation.keyInformation    = txtKeyInformationText.Text;
                hotelInformation.destinationHeader = txtDestinationTitle.Text.Trim();
                hotelInformation.countryHeader     = txtCountryTitle.Text.Trim();
                dealPageHandler.UpdateHotelInformation(hotelInformation);
                deal.DealInformation.HotelInformation = hotelInformation;
            }

            deal.DealInformation.introduction      = txtDealIntro.Text.Trim();
            deal.DealInformation.childPrices       = txtChildPrice.Text.Trim();
            deal.DealInformation.optionalExtras    = txtOptionalExtras.Text.Trim();
            deal.DealInformation.pleaseNote        = txtPleasenote.Text.Trim();
            deal.DealInformation.otherDetails      = txtOtherDetails.Text.Trim();
            deal.DealInformation.otherDetailHeader = txtOtherDetailsHeader.Text.Trim();

            using (GulliverLibrary.Link linkTA = new GulliverLibrary.Link())
            {
                linkTA.name = "Trip Advisor Link";
                linkTA.url  = txtTripAdvisorLink.Text.Trim();
                linkTA.Deal = deal;
                if (linkTA.url.Trim() != string.Empty)
                {
                    links.Add(linkTA);
                }
            }

            deal.DealInformation.dealCurrency        = (cmbCurrency.SelectedItem != null) ? cmbCurrency.SelectedItem.ToString() : "GBP";
            deal.DealInformation.language            = (cmbLanuages.SelectedItem != null) ? cmbLanuages.SelectedItem.ToString() : "English";
            deal.DealInformation.pageName            = txtPageName.Text.Trim();
            deal.DealInformation.leadPrice           = txtLeadPrice.Text.Trim();
            deal.DealInformation.bestDealHeader      = txtBestDealHeader.Text.Trim();
            deal.DealInformation.bestDealDescription = txtBestDealDescription.Text.Trim();
            deal.DealInformation.brand                      = (ddlBrand.SelectedItem != null) ? ddlBrand.SelectedItem.ToString() : string.Empty;
            deal.DealInformation.topHeader                  = txtTopHeader.Text.Trim();
            deal.DealInformation.defaultDuration            = (ddlDurations.SelectedItem != null && ddlDurations.SelectedItem != string.Empty) ? Convert.ToInt32(ddlDurations.SelectedItem) : 0;
            deal.DealInformation.diplayNightsOrDays         = (rbDays.Checked) ? "Days" : "Nights";
            deal.DealInformation.priority                   = Convert.ToInt32(ddlPriorities.SelectedItem);
            deal.DealInformation.goLiveOnBestDealPage       = cbGoLiveOnBestDealPage.Checked;
            deal.DealInformation.information                = txtDealInformation.Text.Trim();
            deal.DealInformation.show1nightlessthanoriginal = cbShow1NightLessOriginal.Checked;

            using (GulliverLibrary.Link linkHW = new GulliverLibrary.Link())
            {
                linkHW.name = "Hotel Website Link";
                linkHW.Deal = deal;
                linkHW.url  = txtHotelLink.Text.Trim();
                if (linkHW.url.Trim() != string.Empty)
                {
                    links.Add(linkHW);
                }
            }

            using (GulliverLibrary.Link pageLink = new GulliverLibrary.Link())
            {
                pageLink.name = "Landing Page Link";
                pageLink.Deal = deal;
                pageLink.url  = ConfigurationManager.AppSettings["fleetwayLivePageURL"].ToString() + ((deal.DealInformation != null) ? deal.DealInformation.pageName : string.Empty) + ".php";
                if (pageLink.url.Trim() != string.Empty)
                {
                    links.Add(pageLink);
                }
            }


            using (GulliverLibrary.Link channelLink = new GulliverLibrary.Link())
            {
                channelLink.name = "Channel Page Link";
                channelLink.Deal = deal;
                channelLink.url  = txtChannelLink.Text.Trim();
                if (channelLink.url.Trim() != string.Empty)
                {
                    links.Add(channelLink);
                }
            }

            List <GulliverLibrary.Image> dealImages = new List <GulliverLibrary.Image>();

            foreach (GulliverIIDS.ImageRow imageRow in this.gulliverIIDS.Image)
            {
                if ((imageRow.Reference != null) && (imageRow.Title != null))
                {
                    try
                    {
                        using (GulliverLibrary.Image dealImage = new GulliverLibrary.Image())
                        {
                            dealImage.id          = imageRow.id;
                            dealImage.Deal        = deal;
                            dealImage.reference   = (imageRow.Reference != null) ? imageRow.Reference : string.Empty;
                            dealImage.altText     = (imageRow.Alt_Text != null) ? imageRow.Alt_Text : string.Empty;
                            dealImage.description = (imageRow.Description != null) ? imageRow.Description : string.Empty;
                            dealImage.title       = (imageRow.Title != null) ? imageRow.Title : string.Empty;
                            dealImages.Add(dealImage);
                        }
                    }
                    catch { }
                }
            }

            SetStepProgressBar(progressBar);
            List <GulliverLibrary.Review> dealReviews = new List <GulliverLibrary.Review>();

            foreach (GulliverIIDS.ReviewRow reviewRow in this.gulliverIIDS.Review)
            {
                try
                {
                    using (GulliverLibrary.Review review = new GulliverLibrary.Review())
                    {
                        review.id     = reviewRow.id;
                        review.Deal   = deal;
                        review.date   = reviewRow.Date;
                        review.source = (reviewRow.Source != null) ? reviewRow.Source : string.Empty;
                        review.stars  = (reviewRow.Stars != null) ? reviewRow.Stars : 0;
                        review.link   = (reviewRow.Link != null) ? reviewRow.Link : string.Empty;
                        review.text   = (reviewRow.Text != null) ? reviewRow.Text : string.Empty;
                        review.title  = (reviewRow.Title != null) ? reviewRow.Title : string.Empty;
                        dealReviews.Add(review);
                    }
                }
                catch { }
            }

            if (this.gulliverIIDS.Room != null && this.gulliverIIDS.Room.Count > 0)
            {
                foreach (GulliverIIDS.RoomRow roomRow in this.gulliverIIDS.Room)
                {
                    GulliverLibrary.HotelContract hotelContract = deal.HotelContracts.SingleOrDefault(h => h.recno == roomRow.recno);

                    if (hotelContract != null)
                    {
                        hotelContract.description = roomRow.Description.Trim();
                        hotelContract.facilities  = roomRow.Facilities.Trim();
                    }
                }
            }
            else
            {
                foreach (GulliverLibrary.HotelContract contract in deal.HotelContracts)
                {
                    contract.description = string.Empty;
                    contract.facilities  = string.Empty;
                }
            }

            if (deal.MetaTag == null)
            {
                deal.MetaTag      = new GulliverLibrary.MetaTag();
                deal.MetaTag.Deal = deal;
            }

            deal.MetaTag.title       = txtMetaTitle.Text.Trim();
            deal.MetaTag.description = txtMetaContent.Text.Trim();
            deal.MetaTag.image       = txtMetaImage.Text.Trim();

            deal.DealImages  = dealImages;
            deal.DealReviews = dealReviews;
            deal.Links       = links;
            SetStepProgressBar(progressBar);
            progressBar.Value = progressBar.Maximum;
            VisibleProgressBar(progressBar, false);
        }