Example #1
0
        private void LoginInner()
        {
            if (string.IsNullOrEmpty(txtUserName.Text))
            {
                MessageBox.Show("用户名不能为空!");
                return;
            }

            if (string.IsNullOrEmpty(txtPassword.Text))
            {
                MessageBox.Show("密码不能为空!");
                return;
            }

            m_Client = new WsDualClient(MyClients.CurrentBinding);

            bool success = m_Client.Login(txtUserName.Text, txtPassword.Text);

            if (!success)
            {
                MessageBox.Show("登录不成功!请检查用户名和密码!");
                return;
            }

            UserHelper.CurrentUser = new UserInfo()
            {
                DisplayName = txtUserName.Text
            };

            IsSave = true;
            this.Close();
        }
Example #2
0
 private void EnsureClient()
 {
     if (m_WsDualClient == null || m_WsDualClient.Factory.State != CommunicationState.Opened)
     {
         m_WsDualClient = new WsDualClient(MyClients.CurrentBinding, this);
         client         = m_WsDualClient.ClientConnector;
     }
 }
Example #3
0
 private void EnsureClientConnector()
 {
     if (NeedRefresh || m_WsDualClient == null || m_WsDualClient.Factory.State != CommunicationState.Opened)
     {
         NeedRefresh    = false;
         m_WsDualClient = new WsDualClient(MyClients.CurrentBinding);
     }
 }
Example #4
0
 /// <summary>
 /// 添加Wcf客户端
 /// </summary>
 /// <param name="serviceType">服务</param>
 /// <param name="client">Wcf客户</param>
 public static void Add(EServiceType serviceType, WsDualClient client)
 {
     dictWcfClients[serviceType] = client;
 }