private void btnAnswer_Click(object sender, EventArgs e) { try { if (base.UserInfoDto.RoleType == "C") { return; } if (string.IsNullOrEmpty(btnShopCode.Text)) { CommonHandler.ShowMessage(MessageType.Information, "请选择经销商"); return; } OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "xml|*.xml"; if (openFileDialog.ShowDialog() == DialogResult.OK) { XmlDocument doc = new XmlDocument(); doc.Load(openFileDialog.FileName); string s = doc.OuterXml; service.AnswerIn(s, CommonHandler.GetComboBoxSelectedValue(cboProjects).ToString(), btnShopCode.Text); CommonHandler.ShowMessage(MessageType.Information, "导入完成,"); } } catch (SqlException ex) { CommonHandler.ShowMessage(MessageType.Information, "请先导入和回答问题有关的其他文件"); } catch (Exception exe) { CommonHandler.ShowMessage(exe); } }