Ejemplo n.º 1
0
        public static void LoadSenStay()
        {
            var StreamlinePropertyList = StreamlinePropertyCollection.Load();

            if (StreamlinePropertyList == null)
            {
                throw new Exception("Streamline codes are not parsed yet");
            }
            Indexes.SenStay = StreamlinePropertyList.CreateIndex();
        }
Ejemplo n.º 2
0
        public static void ParseFolder(string Path)
        {
            var seasons = StreamlineSeasonGroup.Load();
            var streamlineCollection = StreamlinePropertyCollection.Load();
            var units = streamlineCollection.CreateIndex();
            var map   = new PriceMap();
            var files = Temp.GetFileList(@"*.csv", Path);

            foreach (var file in files)
            {
                ProcessSourceFile(file, units, seasons, map);
            }

            CreatePriceScripts(map, units, seasons);


            var airbnbRooms = AirBnbRoomMap.Load();

            PropertyMap.SetMap(airbnbRooms, streamlineCollection);
            CreateAirbnbNY022(map, airbnbRooms);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Pricing sync for AirBnb");
            Config.I.UseProxy = true;

            AirBnbAccounts.Load();
            var roomsMap             = AirBnbRoomMap.Load();
            var streamlineCollection = StreamlinePropertyCollection.Load();

            PropertyMap.SetMap(roomsMap, streamlineCollection);

            var property = PropertyMap.GetBySenstayID("LA029");
            var proxyNum = 0;

            var airAccount = AirBnbAccounts.GetAccountByEmail(property.AirbnbAccountEmail);

            var email = airAccount.Email;

            N.Note("Processing account " + email + " with proxy " + airAccount.ProxyAddress[proxyNum]);
            var profile = SeleniumProxy.GetFirefoxProfileWithProxy(airAccount.ProxyAddress, proxyNum);

            using (var driver = SeleniumFactory.GetFirefoxDriver(profile))
            {
                var signInSucceed = AirBnbLogin.Process(driver, airAccount);
                if (signInSucceed.Status != AirBnbLoginStatus.Sucess)
                {
                    N.Note("Password for " + email + " is wrong or account unreachable");
                    try
                    {
                        driver.Quit();
                    }
                    catch
                    {
                        // ignored
                    }
                }
                AirBnbCalendar.SetPricesForUnit(driver, property, AirbnbUnitDailyPriceList.Load());
            }
        }