public static BLLUsers.UserManagerServiceClient GetUserService() { if (userClient == null) { userClient = new BLLUsers.UserManagerServiceClient(); } if (userClient.State == CommunicationState.Closed) { userClient = new BLLUsers.UserManagerServiceClient(); } if (userClient.State == CommunicationState.Faulted) { userClient = new BLLUsers.UserManagerServiceClient(); } return(userClient); }
private void buttonLogin_Click(object sender, EventArgs e) { BLLUsers.UserManagerServiceClient client = WCFServiceBLL.GetUserService(); Model.UserModel userModel = client.Login(textBoxUserName.Text, textBoxPassword.Text); if (userModel != null) { AppParams.CurrentUser = userModel; this.LogType = 1; this.Hide(); } else { MessageBox.Show("登录失败,确认帐号密码是否正确"); } }