private void btnLogin_Click(object sender, EventArgs e) { if (txtPassword.Text == "") { return; } if (ThisAddIn.CanOption(ElementNames.UKey)) { IsUkey(); return; } if (lblUserName.Text.Trim() != "" && txtPassword.Text == passwd) { Globals.DoctorID = txtUserCode.Text; Globals.OpDepartID = departmentCode; Globals.DoctorName = lblUserName.Text; // Globals.AreaID = ThisAddIn.GetAreaID(departmentCode); XmlNode Config = null; string msg = ThisAddIn.GetConfig(ref Config); if (msg == null || msg == "") { Globals.Config = Config; RetrieveMyroles(txtUserCode.Text); //ThisAddIn.RetrieveMyrolesHIS(txtUserCode.Text); this.DialogResult = DialogResult.OK; txtPassword.Text = ""; txtUserCode.Text = ""; lblUserName.Text = ""; lblDepartment.Text = ""; txtUserCode.Focus(); this.Hide(); if (Globals.WriteOff) { MainForm m = new MainForm(); m.Show(); Globals.WriteOff = false; } return; } MessageBox.Show(msg); this.DialogResult = DialogResult.Cancel; this.Close(); } else { MessageBox.Show("无效的用户名或密码!"); txtUserCode.Text = ""; txtPassword.Text = ""; departmentCode = ""; lblUserName.Text = ""; departName = ""; } }