private void Init()
        {
            TemplateTables = null;
            CommonConfigurationModel configuration = new CommonConfigurationModel();
            CommonConfig             common        = configuration.GetConfiguration();
            Database database = new Database(common.DatabaseHost, common.DatabaseUser, common.DatabasePassword, common.DatabaseName, (uint)common.DatabasePort);

            database.GetTemplates();
            TemplateTables = database.TemplateTables;
            Template       = _template;
        }
Пример #2
0
        public void ShowResultButton()
        {
            CommonConfigurationModel configuration = new CommonConfigurationModel();
            CommonConfig             common        = configuration.GetConfiguration();
            Database database = new Database(common.DatabaseHost, common.DatabaseUser, common.DatabasePassword, common.DatabaseName, (uint)common.DatabasePort);

            database.SetResultView(StartDate, EndDate);
            database.GetResultView();
            Result = database.ResultViews.ToList();
            database.DropResultView();
            NavigationService.Navigate(typeof(ResultPage), Result);
        }
Пример #3
0
 public ACommonConfigModelView()
 {
     _startConfig       = new CommonConfig();
     _configuration     = new CommonConfigurationModel();
     _startConfig       = _configuration.GetConfiguration();
     AgencyName         = _startConfig.AgencyName;
     AgencyNumber       = _startConfig.AgencyNumber;
     AgencyPassword     = _startConfig.AgencyPassword;
     AgencySalespoint   = _startConfig.AgencySalespoint;
     DatabasePassword   = _startConfig.DatabasePassword;
     DatabaseHost       = _startConfig.DatabaseHost;
     DatabaseName       = _startConfig.DatabaseName;
     DatabaseRemoteHost = _startConfig.DatabaseRemote;
     DatabaseUser       = _startConfig.DatabaseUser;
     DatabasePort       = _startConfig.DatabasePort;
     FormLimit          = _startConfig.FormLimit;
     PageLimit          = _startConfig.PageLimit;
     SearchLimit        = _startConfig.SearchLimit;
 }
Пример #4
0
        private void Init()
        {
            Websites = null;

            try
            {
                _common = _configuration.GetConfiguration();
                Database database = new Database(_common.DatabaseHost, _common.DatabaseUser, _common.DatabasePassword, _common.DatabaseName, (uint)_common.DatabasePort);
                database.GetTemplates();
                _website = database.TemplateTables.ToList();
            }
            catch (Exception exception)
            {
                Debug.Assert(true, exception.Message);
            }

            Websites = _website;
            FileList = model.GetFiles();
            FileList.Sort();
            _travelPoints      = PrefListModel.FlightPoints.ToList();
            TravelPoints       = _travelPoints;
            _isRoundtripPushed = false;
        }
        public async void SaveTemplate()
        {
            CommonConfigurationModel configuration = new CommonConfigurationModel();
            CommonConfig             common        = configuration.GetConfiguration();
            Database            database           = new Database(common.DatabaseHost, common.DatabaseUser, common.DatabasePassword, common.DatabaseName, (uint)common.DatabasePort);
            TemplateConfigModel configModel        = new TemplateConfigModel();

            if (string.IsNullOrEmpty(_template.CommonInfo.WebsiteName) ||
                string.IsNullOrEmpty(_template.CommonInfo.WebsiteUrl))
            {
                return;
            }
            await configModel.SetConfiguration(_template);

            try
            {
                database.InsertTemplatesToDatabase(Template.CommonInfo.WebsiteName, "/Templates/",
                                                   Template.CommonInfo.WebsiteName + ".xml");
            }
            catch (Exception exception)
            {
                Debug.Assert(true, exception.Message);
            }
        }
Пример #6
0
        /// <summary>
        /// In this method we receive data that was defined in B2B_app application and required for websites and web service investigation
        /// </summary>
        public void GetDataFromUser()
        {
            string        data     = RemoteSave.GetContentFromFtp("conf", RemoteSave.State.INTERMEDIATE);
            var           strArr   = data.Split(Environment.NewLine.ToCharArray());
            List <string> condData = strArr.Where(s => !String.IsNullOrEmpty(s)).ToList();
            var           temp     = condData[0];
            var           temp2    = temp.Split(';');

            foreach (string s in temp2.Where(s => !String.IsNullOrEmpty(s)))
            {
                SiteNames.Add(s);
            }
            temp  = condData[1];
            temp2 = temp.Split(';');
            bool flag;

            foreach (string s in temp2)
            {
                if (!String.IsNullOrEmpty(s))
                {
                    var   temp3 = s.Split('-');
                    Route route = new Route();
                    flag = true;
                    foreach (string s1 in temp3.Where(s1 => !String.IsNullOrEmpty(s1)))
                    {
                        if (flag)
                        {
                            route.Departure = s1;
                            flag            = false;
                        }
                        else
                        {
                            if (s1 != '-'.ToString())
                            {
                                route.Arrival = s1;
                            }
                        }
                    }
                    FlightLegs.Add(route);
                }
            }
            temp  = condData[2];
            temp2 = temp.Split(';');
            flag  = true;
            foreach (string s in temp2)
            {
                if (!String.IsNullOrEmpty(s))
                {
                    if (flag)
                    {
                        // 2016-07-20T15:00:00Z
                        DepartureDate = s;
                        flag          = false;
                    }
                    else
                    {
                        if (s != ';'.ToString())
                        {
                            ArrivalDate = s;
                        }
                    }
                }
            }
            temp           = condData[3];
            temp2          = temp.Split(';');
            ConfigFilePath = temp2[0];
            Config         = new CommonConfig();
            Config         = _configuration.GetConfiguration(ConfigFilePath);
            foreach (string siteName in SiteNames)
            {
                WebsiteDomList.Add(RemoteSave.GetContentFromFtp(siteName, RemoteSave.State.TEMPLATE));
            }
            TemplateConfigModel template = new TemplateConfigModel();

            foreach (string s in SiteNames)
            {
                WebsiteTemplates.Add(template.GetConfiguration(s));
            }
        }