Exemplo n.º 1
0
        private void btnNetSave_Click(object sender, EventArgs e)
        {
            try
            {
                _params.HostName = teIp.Text;
                _params.Port     = int.Parse(tePort.Text);
                var strAddress = string.Format("http://{0}:{1}/ClientBonusService/", _params.HostName, _params.Port);
                _service = new ClientBonusServiceClient("BasicHttpBinding_IClientBonusService", strAddress);

                _params.Save();

                MessageBox.Show(
                    this,
                    Resources.LoginForm_ConnectionParamsAreSaved,
                    Resources.LoginForm_MessageCaption,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
            }
            catch (Exception)
            {
                MessageBox.Show(
                    this,
                    Resources.LoginForm_btnNetSave_BadData,
                    Resources.LoginForm_MessageCaption,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
                _params = ClientParams.Load();
            }
        }
Exemplo n.º 2
0
        public LoginForm(IClientBonusService service)
        {
            _service = service;
            InitializeComponent();
            _params      = ClientParams.Load();
            teLogin.Text = _params.UserName;

            if (_params.RoleType.HasValue)
            {
                switch (_params.RoleType.Value)
                {
                case RoleTypes.Payin:
                    cbRole.SelectedIndex = 0;
                    break;

                case RoleTypes.Payout:
                    cbRole.SelectedIndex = 1;
                    break;
                }
            }

            teIp.Text   = _params.HostName;
            tePort.Text = _params.Port.ToString();
        }