private void txtUserCode_Leave(object sender, EventArgs e) { txtUserCode.Text = udt.NormalizeOpcode(txtUserCode.Text); lblUserName.Text = ""; bool ret = Return.Failed; string userName = ""; if (txtUserCode.Text.Length == 4) { ret = ThisAddIn.GetOperatorInf(txtUserCode.Text, ref userName, ref passwd, ref departmentCode, ref departName); } if (ret == Return.Successful) { lblUserName.Text = userName; lblDepartment.Text = departName; Globals.OpDepartName = departName; Globals.OpDepartID = departmentCode; } else { lblUserName.Text = ""; lblDepartment.Text = ""; } }