Exemple #1
0
        public FrenoySync(FrenoySyncOptions options, bool isVttl = true)
        {
            _db = new TtcDbContext();

            #region Switch between VTTL and Sporta here
            // TODO: Pointless to use the EF logging: Parameter values are not part of the output...
            //_logFileInfo = new FileInfo(@"C:\temp\log" + DateTime.Now.ToString("hh:mm:ss").Replace(":", "") + ".txt");
            //_logFile = new StreamWriter(_logFileInfo.FullName);
            //_db.Database.Log = message => _log.AppendLine(message);

            // TODO: The logs contain parameters without the values, so the queries are useless
            // -> Perhaps Glimpse can help here? It got some parameter replacement thingie

            _options = options;
            //CheckPlayers();

            _isVttl = isVttl;
            //string wsdl;
            if (isVttl)
            {
                _thuisClubId = _db.Clubs.Single(x => x.CodeVttl == options.FrenoyClub).Id;
                //wsdl = FrenoyVttlWsdlUrl;
            }
            else
            {
                // Sporta
                _thuisClubId = _db.Clubs.Single(x => x.CodeSporta == options.FrenoyClub).Id;
                //wsdl = FrenoySportaWsdlUrl;
            }

            // Aparently the signatures for VTTL and Sporta are not identical
            // Problem is probably stuff like: xmlns="http://api.frenoy.net/TabTAPI" in the body
            //var binding = new BasicHttpBinding();
            //binding.Security.Mode = BasicHttpSecurityMode.None;
            //var endpoint = new EndpointAddress(wsdl);
            //_frenoy = new TabTAPI_PortTypeClient(binding, endpoint);
            #endregion

            // Right click the Service Reference and update with different Url...
            _frenoy = new FrenoyVttl.TabTAPI_PortTypeClient();
        }
        public FrenoySync(FrenoySyncOptions options, bool isVttl = true)
        {
            _db = new TtcDbContext();

            #region Switch between VTTL and Sporta here
            // TODO: Pointless to use the EF logging: Parameter values are not part of the output...
            //_logFileInfo = new FileInfo(@"C:\temp\log" + DateTime.Now.ToString("hh:mm:ss").Replace(":", "") + ".txt");
            //_logFile = new StreamWriter(_logFileInfo.FullName);
            //_db.Database.Log = message => _log.AppendLine(message);

            // TODO: The logs contain parameters without the values, so the queries are useless
            // -> Perhaps Glimpse can help here? It got some parameter replacement thingie

            _options = options;
            //CheckPlayers();

            _isVttl = isVttl;
            //string wsdl;
            if (isVttl)
            {
                _thuisClubId = _db.Clubs.Single(x => x.CodeVttl == options.FrenoyClub).Id;
                //wsdl = FrenoyVttlWsdlUrl;
            }
            else
            {
                // Sporta
                _thuisClubId = _db.Clubs.Single(x => x.CodeSporta == options.FrenoyClub).Id;
                //wsdl = FrenoySportaWsdlUrl;
            }

            // Aparently the signatures for VTTL and Sporta are not identical
            // Problem is probably stuff like: xmlns="http://api.frenoy.net/TabTAPI" in the body
            //var binding = new BasicHttpBinding();
            //binding.Security.Mode = BasicHttpSecurityMode.None;
            //var endpoint = new EndpointAddress(wsdl);
            //_frenoy = new TabTAPI_PortTypeClient(binding, endpoint);
            #endregion

            // Right click the Service Reference and update with different Url...
            _frenoy = new FrenoyVttl.TabTAPI_PortTypeClient();
        }