Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            // if (txtUsername.Text=="admin"&&txtPassword.Text=="123gaga123@")
            if (service.Login(txtUsername.Text, txtPassword.Text, eUserType.Bet, SelfInfo.Ip, SelfInfo.MacAddress, SelfInfo.Hostname))
            {
                Settings.Default.Username = txtUsername.Text;
                Settings.Default.Password = txtPassword.Text;
                Settings.Default.Save();

                SelfInfo.Username = txtUsername.Text;
                var scanType = service.RouteType(SelfInfo.Username);
                SetupBetConfigDTO betConfig = service.BetSetupConfig(SelfInfo.Username, scanType);

                DataContainer.HasLocalScan                   = betConfig.HasLocalScan;
                SystemConfig.TIME_GET_UPDATE_LIVE_IBET       = betConfig.TimeScanLiveIbet;
                SystemConfig.TIME_GET_UPDATE_NON_LIVE_IBET   = betConfig.TimeScanNonLiveIbet;
                SystemConfig.TIME_GET_UPDATE_LIVE_SBOBET     = betConfig.TimeScanLiveSbo;
                SystemConfig.TIME_GET_UPDATE_NON_LIVE_SBOBET = betConfig.TimeScanNonLiveSbo;
                DataContainer.SboScanAccounts                = betConfig.SboScanAccounts;
                DataContainer.SboScanServers                 = betConfig.SboScanServers;
                ClientData.EndpointRoute = betConfig.EndpointRoute;

                frmMainIbetSbo form = new frmMainIbetSbo(service);
                form.Show();
                this.Hide();
            }
            else
            {
                if (logFail >= 2)
                {
                    MessageBox.Show(
                        "Bạn đăng nhập sai quá nhiều lần, hệ thống đã tự gởi email đến người quản trị.\n Vui lòng liên lạc người quản trị để lấy mật khẩu mới!",
                        "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                }
                else
                {
                    lblInfo.Text = "Thông tin sai! Vui lòng thử lại.";
                    logFail++;
                }
            }
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (service.Login(textBox1.Text, textBox2.Text, eUserType.Scan, SelfInfo.Ip, SelfInfo.MacAddress, SelfInfo.Hostname))
            {
                Settings.Default.Username         = textBox1.Text;
                Settings.Default.Password         = textBox2.Text;
                Settings.Default.ScanEndpoint     = int.Parse(txtScanType.Text);
                Settings.Default.OddCompare       = float.Parse(txtOddCompare.Text);
                Settings.Default.IbetTimeScan     = (int)numIbetLiveTime.Value;
                Settings.Default.SboTimeScan      = (int)numSboLiveTime.Value;
                Settings.Default.IbetTodayScan    = (int)numIbetTodayTime.Value;
                Settings.Default.SboTodayScan     = (int)numSboTodayTime.Value;
                Settings.Default.IbetProxyAddress = txtProxyIbetAddress.Text;
                Settings.Default.IpAddress        = txtIpAddress.Text;
                Settings.Default.HasFakeIpSbo     = ckFakeIpSbo.Checked;
                Settings.Default.IpFakeSource     = txtIpFakeSource.Text;
                Settings.Default.Save();

                if (!string.IsNullOrEmpty(txtIpAddress.Text))
                {
                    var ipList = txtIpAddress.Text.Split(new string[] { Environment.NewLine, "\n" }, StringSplitOptions.None);
                    ScanData.IpAddress = ipList.ToList();
                }

                if (!string.IsNullOrEmpty(txtIpFakeSource.Text))
                {
                    var ipList = txtIpFakeSource.Text.Split(new string[] { Environment.NewLine, "\n" }, StringSplitOptions.None);
                    DataContainer.SourceIpFakes = ipList.ToList();
                }

                Process.OddCompare        = Settings.Default.OddCompare;
                ScanData.HasFakeIpSbo     = ckFakeIpSbo.Checked;
                ScanData.ScanEndpointType = Settings.Default.ScanEndpoint;
                SelfInfo.Username         = textBox1.Text;
                if (string.IsNullOrEmpty(Settings.Default.IbetProxyAddress))
                {
                    ScanData.ProxyLoginIbet = false;
                }
                else
                {
                    ScanData.ProxyLoginIbet         = true;
                    ScanData.ProxyLoginIbetEndpoint = string.Concat("net.tcp://", Settings.Default.IbetProxyAddress, ":9998/bcwinsupservice");
                }

                SetupScanConfigDTO scanConfig = service.ScanConfig(SelfInfo.Username, ScanData.ScanEndpointType);
                scanConfig.TimeScanLiveIbet = Settings.Default.IbetTimeScan;
                scanConfig.TimeScanLiveSbo  = Settings.Default.SboTimeScan;
                ScanAccountDTO scanAccount = service.ScanAccount(SelfInfo.Username);

                //if (scanAccount.IbetAccounts.Count == 0 || scanAccount.SboAccounts.Count == 0)
                //{
                //    var msg = string.Format("Tong tai khoang sbo {0} & ibet {1}", scanAccount.SboAccounts.Count, scanAccount.IbetAccounts.Count);
                //    MessageBox.Show(msg);
                //}
                ScanData.ScanAccount = scanAccount;
                Init(scanConfig);

                frmMain f = new frmMain(service);
                f.Show();
                this.Hide();
            }
        }