Ejemplo n.º 1
0
        public flcsDealPage(int id)
        {
            InitializeComponent();
            dealPageHandler            = new PackageGenerator.PackageHandler(true, ConfigurationManager.AppSettings["enviroment"].ToString());
            deal                       = dealPageHandler.GetDealById(id);
            dataProcessor              = new LandingPageHandler.DataProcessor();
            queryHandler               = new MySqlDataHandler.QueryHandler();
            this.tabControl2.DrawMode  = TabDrawMode.OwnerDrawFixed;
            this.tabControl2.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.tabControl2_DrawItem);
            ddlDurations.DataSource    = deal.durations.Split('#').ToList();
            List <string> currencys = dealPageHandler.GetAllCurrencys();

            cmbCurrency.DataSource = currencys;

            email = new PackageGenerator.Email();

            if (deal.DealInformation != null)
            {
                FillDealInformation();
            }
            else
            {
                FillDefaultImages();
            }
        }
 public flcsAutoUpdateSetting(int dealId)
 {
     packageHandler = new PackageGenerator.PackageHandler(false, ConfigurationManager.AppSettings["enviroment"].ToString());
     deal           = packageHandler.GetDealById(dealId);
     InitializeComponent();
     FillAutoUpdateSettings(dealId);
 }
Ejemplo n.º 3
0
 public flcsOtherChannels(GulliverLibrary.QueryHandler gulliverQueryHandler, GulliverLibrary.Deal deal)
 {
     InitializeComponent();
     this.gulliverQueryHandler = gulliverQueryHandler;
     packageHandler            = new PackageGenerator.PackageHandler(false, ConfigurationManager.AppSettings["enviroment"].ToString());
     this.deal = deal;
     FillMedia();
 }
Ejemplo n.º 4
0
        private void RestorePackages()
        {
            using (GulliverLibrary.Deal deal = packageHandler.GetDealById(dealId))
            {
                travelZooSuppliers = PackageGenerator.Tool.GetSuppliersBySuppliertype("traveltypesuppliers");
                timesSuppliers     = PackageGenerator.Tool.GetSuppliersBySuppliertype("timestypesuppliers");
                seSupplier         = PackageGenerator.Tool.GetSuppliersBySuppliertype("setypesuppliers");

                packages = (from h in packageBackups
                            select new GulliverLibrary.Package
                {
                    id = h.id,
                    date = h.date,
                    departureAirport = h.departureAirport,
                    destinationAirport = h.destinationAirport,
                    duration = h.duration,
                    obDepartureTime = h.obDepartureTime,
                    obArrivalTime = h.obArrivalTime,
                    ibDepartureTime = h.ibDepartureTime,
                    ibArrivalTime = h.ibArrivalTime,
                    board = h.board,
                    flightPrice = h.flightPrice,
                    airline = h.airline,
                    obAirline = h.obAirline,
                    ibAirline = h.ibAirline,
                    hotelPrice = h.hotelPrice,
                    caa = h.caa,
                    baggagePrice = h.baggagePrice,
                    transfers = h.transfers,
                    extras = h.extras,
                    totalMarkup = h.totalMarkup,
                    commission = h.commission,
                    nett = h.nett,
                    sellAt = h.sellAt,
                    flightSource = h.flightSource,
                    hotelSource = h.hotelSource,
                    Deal = deal,
                    status = h.status,
                    carhireCosting = h.carhireCosting,
                    carParkingCosting = (h.extras - (h.caa + h.baggagePrice + h.transfers + h.carhireCosting)),
                    profit = ((travelZooSuppliers.Contains(deal.Media.id) || timesSuppliers.Contains(deal.Media.id)) ? h.totalMarkup : 0),
                    hotelKey = string.Empty,
                    tsRoomKey = (h.tsRoomKey != null)? h.tsRoomKey: string.Empty,
                    leading = false
                }).ToList();
            }
        }
Ejemplo n.º 5
0
 private void flcsSetLeading_FormClosing(object sender, FormClosingEventArgs e)
 {
     using (GulliverLibrary.Deal deal = packageHandler.GetDealById(dealId))
     {
         leadingPrices = (from l in this.packagesDS1.LeadingPrices
                          select new GulliverLibrary.LeadingPrice
         {
             id = l.id,
             Deal = deal,
             duration = l.Duration,
             occupancy = l.Occupancy,
             departureAirport = l.DepartureAirport,
             leadingPrice = l.Leading_Price,
             lockTheLeading = l.LockTheLeading
         }).ToList();
         packageHandler.UpdateLeadingPrices(leadingPrices, deal.id);
     }
 }
Ejemplo n.º 6
0
        private void btnUpdateFleetwayPage_Click(object sender, EventArgs e)
        {
            if (deal.id != 0)
            {
                deal = dealPageHandler.GetDealById(deal.id);
                string message = dataProcessor.UpdateFleetwayPage(deal, cbAirportByAvailability.Checked, false);

                if (message != string.Empty)
                {
                    lblError.Visible = true;
                    lblError.Text    = message;
                }
                else
                {
                    string url = ConfigurationManager.AppSettings["fleetwaydraftPageURL"].ToString() + deal.DealInformation.pageName.Trim() + ".php";
                    System.Diagnostics.Process.Start(url);
                    this.Focus();
                }
            }
            else
            {
                MessageBox.Show("Please save the offer before you generate any page for Fleetway website!");
            }
        }