public ChangePasswordForm(ref admin.DataServiceSoapClient dataService, ref string userID)
		{
			this.InitializeComponent();
			this._dataService = dataService;
			this._dataService.ChangePasswordCompleted += new EventHandler<admin.ChangePasswordCompletedEventArgs>(this._dataService_ChangePasswordCompleted);
			this._currentUserID = userID;
		}
 public ChangePasswordForm(ref admin.DataServiceSoapClient dataService, ref string userID)
 {
     this.InitializeComponent();
     this._dataService = dataService;
     this._dataService.ChangePasswordCompleted += new EventHandler <admin.ChangePasswordCompletedEventArgs>(this._dataService_ChangePasswordCompleted);
     this._currentUserID = userID;
 }
		private void InitializeObjects()
		{
			this._systemTimer = new System.Windows.Forms.Timer();
			this._systemTimer.Interval = 1000;
			this._systemTimer.Tick += new System.EventHandler(this._systemTimer_Tick);
			this._systemTimer.Start();
                        
			this._listTerminal = new System.Collections.Generic.List<TerminalFormIBET3IN1>();
            this._listTerminal2 = new System.Collections.Generic.List<TerminalFormIBETSBO>();
            this._listTerminal3 = new System.Collections.Generic.List<FollowSub>();
			this._listTransaction = new System.Collections.Generic.List<TransactionDTO>();
            this._list3in1Host = new List<string>();            

			this.grdTransaction.DataSource = this._listTransaction;
            this._dataService = new DataServiceSoapClient();
            if (this._dataService.Endpoint.ListenUri.ToString().Contains("http://demo.tranbros.com") || this._dataService.Endpoint.ListenUri.ToString().Contains("http://apbenvironment.com"))
            {
                this._dataService.LoginCompleted += new EventHandler<admin.LoginCompletedEventArgs>(this._dataService_LoginCompleted);
            }
			
			this.Text = "Bet Broker - Version: " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            //System.Collections.Generic.List<MatchDTO> testList = SbobetEngine.ConvertFullDataNew("[29887,0,1,[[[283,'Japan Emperor Cup','',''],[1948,'Spain Women Superliga','',''],[20831,'Indonesia Liga Divisi Utama Playoff','',''],[26674,'Korea K-League Classic Playoff','','']],[[1290020,1,283,'Tokyo Verdy','V-Varen Nagasaki','1.733',10,'09/08/2013 16:00',1,'',5],[1295232,1,283,'Tokyo Verdy (ET)','V-Varen Nagasaki (ET)','1.733A',10,'09/08/2013 16:00',0,'',5],[1295233,1,283,'Tokyo Verdy (PEN)','V-Varen Nagasaki (PEN)','1.733B',10,'09/08/2013 16:00',0,'',1],[1295234,1,283,'Tokyo Verdy (PEN)','V-Varen Nagasaki (PEN)','1.733C',10,'09/08/2013 16:00',0,'',1],[1291865,1,1948,'CD San Gabriel (w)','SC Huelva (w)','1.862',10,'09/08/2013 17:00',1,'',6],[1294201,1,20831,'Persikabo Bogor (n)','Persebaya Surabaya','1.891',10,'09/08/2013 16:30',0,'',3],[1293714,1,26674,'Jeonbuk Hyundai Motors','Pohang Steelers','1.734',6,'09/08/2013 16:00',1,'SG: CH 222',2]],[[352993,1290020,0,2,2,5],[361811,1295232,0,0,0,5],[361812,1295233,0,0,0,1],[361813,1295234,0,0,0,1],[356455,1291865,0,1,0,6],[360499,1294201,0,0,1,3],[359357,1293714,0,0,3,2]],[[352993,2,2,40,45,0,0,0],[361811,2,0,10,15,0,0,0],[361812,0,0,9,45,0,0,0],[361813,0,0,9,45,0,0,0],[356455,1,1,38,45,0,0,0],[360499,1,2,6,45,0,0,0],[359357,1,2,40,45,0,0,0]],,[[14311764,[352993,1,1,5000.00,0.00],[-0.98,0.9]],[14311765,[352993,1,1,3000.00,0.25],[-0.29,0.21]],[14311767,[352993,3,1,5000.00,4.50],[-0.36,0.28]],[14311768,[352993,3,1,3000.00,4.75],[-0.26,0.18]],[14392379,[361811,1,1,8000.00,0.00],[0.99,0.93]],[14392380,[361811,1,1,5000.00,0.25],[-0.55,0.47]],[14392382,[361811,3,1,8000.00,0.75],[-0.99,0.89]],[14392383,[361811,3,1,3000.00,0.50],[0.7,-0.8]],[14392400,[361812,1,1,8000.00,0.00],[0.88,-0.96]],[14392425,[361813,3,1,5000.00,7.00],[-0.85,0.75]],[14341997,[356455,1,1,1000.00,0.25],[0.99,0.85]],[14341999,[356455,3,1,1000.00,2.75],[0.92,0.9]],[14341998,[356455,7,1,500.00,0.00],[0.54,-0.7]],[14342000,[356455,9,1,500.00,1.50],[-0.43,0.25]],[14375895,[360499,1,1,500.00,-0.25],[0.81,-0.97]],[14375897,[360499,3,1,500.00,2.00],[0.84,0.98]],[14393227,[359357,1,1,3000.00,0.00],[0.75,-0.83]],[14393229,[359357,3,1,3000.00,3.50],[-0.39,0.31]]],,,'Fu\xDFball',0],[[],[],[1290020,1293714,1291865,1295232,1295233,1295234],0],,,0]");



		}
        public TerminalFormIBETSBO(MainForm mainForm, string currentUserID, int formCount)
        {
            

            this.InitializeComponent();
            List<BetAgentConfig> agents = ConfigurationInstance<BetEngineConfiguration>.GetConfig().Agents;
            this.config = agents[formCount];
            
            
            //list.Add("55640842");
            //Thread thread = new Thread((ThreadStart)(() =>
            //{
            //    this.engineManager = new BetEngineManager();
            //    List<string> list = new List<string>();
            //    this.engineManager.Start(list);
            //}));
            //thread.Start();
            this.scantype = new ScanningType();
            this._ibetMatchs = new Dictionary<string, IbetMatch>();
            this._ibetMatchsSnapShot = new Dictionary<string, IbetMatch>();
            this._sboMatchs = new Dictionary<string, SboMatch>(); 

            this._mainForm = mainForm;
            this._dataService = new App.admin.DataServiceSoapClient();
            this._dataService.AllowRunCompleted += new System.EventHandler<iBet.App.admin.AllowRunCompletedEventArgs>(this._dataService_AllowRunCompleted);
            this._currentUserID = currentUserID;
            this._forceRefreshTimer = new System.Windows.Forms.Timer();
            this._forceRefreshTimer.Interval = 180000;
            this._forceRefreshTimer.Tick += new System.EventHandler(this._forceRefreshTimer_Tick);

            this._creditRefreshTimer = new System.Windows.Forms.Timer();
            this._creditRefreshTimer.Interval = 180000;
            this._creditRefreshTimer.Tick += new System.EventHandler(this._creditRefreshTimer_Tick);

            this._matchesRefreshTimer = new System.Windows.Forms.Timer();
            this._matchesRefreshTimer.Interval = 60000;
            this._matchesRefreshTimer.Tick += new System.EventHandler(this._matchesRefreshTimer_Tick);

            this._oddTransactionHistory = new System.Collections.Generic.Dictionary<string, string>();
            this._listTransaction = new System.Collections.Generic.List<TransactionDTO>();
            this.grdTransaction.DataSource = this._listTransaction;
            this._listSameMatch = new System.Collections.Generic.List<MatchDTO>();
            this.grdSameMatch.DataSource = this._listSameMatch;
            this.listBA = new List<BetAnalyse>();
            this.bl = new List<Bet>();
            this.girdBetList1.DataSource = this.bl;





            //MatchDTO match = new MatchDTO();
            //match.HomeTeamName = "Test Home Team";
            //match.AwayTeamName = "Another Away Team";
            //match.HomeScore = "0";
            //match.AwayScore = "0";
            //match.Minute = 28;
            //match.Half = 1;
            //match.KickOffTime = "20/10 13:41 Live!";
            //match.League = new LeagueDTO();
            //match.League.Name = "Ein Element mit dem gleichen Schlüssel".ToUpper();

            //MatchDTO match2 = new MatchDTO();
            //match2.HomeTeamName = "Test Home Team";
            //match2.AwayTeamName = "Another Away Team";
            //match2.HomeScore = "0";
            //match2.AwayScore = "0";
            //match2.Minute = 28;
            //match2.Half = 1;
            //match2.KickOffTime = "20/10 13:43";
            //match2.League = new LeagueDTO();
            //match2.League.Name = "Ein Element mit dem gleichen Schlüssel".ToUpper();

            //this._listSameMatch.Add(match); this._listSameMatch.Add(match);
            //this._listSameMatch.Add(match); this._listSameMatch.Add(match);
            //this._listSameMatch.Add(match); this._listSameMatch.Add(match);
            //this._listSameMatch.Add(match); this._listSameMatch.Add(match);
            //this._listSameMatch.Add(match2); this._listSameMatch.Add(match2); this._listSameMatch.Add(match2);
            //this._listSameMatch.Add(match2); this._listSameMatch.Add(match2); this._listSameMatch.Add(match2);
            //this._listSameMatch.Add(match2); this._listSameMatch.Add(match2);
            //this.gridView1.RefreshData();
        }
		public TerminalFormIBET3IN1(MainForm mainForm, string currentUserID)
		{
			this.InitializeComponent();
			this._mainForm = mainForm;
            this._dataService = new App.admin.DataServiceSoapClient();
			this._dataService.AllowRunCompleted += new EventHandler<AllowRunCompletedEventArgs>(this._dataService_AllowRunCompleted);
			this._currentUserID = currentUserID;
			
            this._forceRefreshTimer = new System.Windows.Forms.Timer();
			this._forceRefreshTimer.Interval = 180000;
			this._forceRefreshTimer.Tick += new System.EventHandler(this._forceRefreshTimer_Tick);

			this._creditRefreshTimer = new System.Windows.Forms.Timer();
			this._creditRefreshTimer.Interval = 180000;
			this._creditRefreshTimer.Tick += new System.EventHandler(this._creditRefreshTimer_Tick);

            //this._matchesRefreshTimer = new System.Windows.Forms.Timer();
            //this._matchesRefreshTimer.Interval = 60000;
            //this._matchesRefreshTimer.Tick += new System.EventHandler(this._matchesRefreshTimer_Tick);

			this._oddTransactionHistory = new System.Collections.Generic.Dictionary<string, System.DateTime>();
			this._listTransaction = new System.Collections.Generic.List<TransactionDTO>();

            //this.web3IN1BET.Url = new System.Uri("http://" + _mainForm._list3in1Host[_mainForm.numTerminal] + ".3in1bet.com", System.UriKind.Absolute);

            //TransactionDTO tranTest = new TransactionDTO(); 
            //tranTest.AwayTeamName = "test"; tranTest.HomeTeamName = "test";
            //this._listTransaction.Add(tranTest);

			this.grdTransaction.DataSource = this._listTransaction;
			this._listSameMatch = new System.Collections.Generic.List<MatchDTO>();
			this.grdSameMatch.DataSource = this._listSameMatch;
		}
        public FollowSub(MainForm mainForm, string currentUserID)
        {
            this.InitializeComponent();
            this._mainForm = mainForm;
            this._dataService = new App.admin.DataServiceSoapClient();
            this._dataService.AllowRunCompleted += new EventHandler<AllowRunCompletedEventArgs>(this._dataService_AllowRunCompleted);
            this._currentUserID = currentUserID;
            this._forceRefreshTimer = new System.Windows.Forms.Timer();
            this._forceRefreshTimer.Interval = 180000;
            this._forceRefreshTimer.Tick += new System.EventHandler(this._forceRefreshTimer_Tick);

            this._creditRefreshTimer = new System.Windows.Forms.Timer();
            this._creditRefreshTimer.Interval = 180000;
            this._creditRefreshTimer.Tick += new System.EventHandler(this._creditRefreshTimer_Tick);



            //this._OldBetListHistory = new Dictionary<string, DateTime>();
            //this._oddTransactionHistory = new System.Collections.Generic.Dictionary<string, System.DateTime>();
            this._listTransaction = new System.Collections.Generic.List<TransactionDTO>();

            this._listWaitingTransaction = new System.Collections.Generic.List<TransactionDTO>();
            this.grdTransaction.DataSource = this._listTransaction;

            this._listIBETMatchNow = new List<MatchDTO>();
            this.grdSameMatch.DataSource = this._listIBETMatchNow;

            this._listIBETMatchNonLiveNow = new List<MatchDTO>();
            this.gridNonLiveMatch.DataSource = this._listIBETMatchNonLiveNow;

            this._lastAccountInSubOutStanding = new List<AccountDTO>();
            this._listDoneBetInSub = new List<BetDTO>();
            this.grdBetList.DataSource = this._listDoneBetInSub;
            //this.grdBetList.DataSource = this._
        }