private void button4_Click(object sender, EventArgs e) { SRR.HisApplayClient SS = new SRR.HisApplayClient(); var outxml = SS.sendToHis(richTextBox1.Text); richTextBox2.Text = outxml; }
private void button1_Click(object sender, EventArgs e) { var trade = comboBox1.Text;// .SelectedItem.ToString(); if (string.IsNullOrEmpty(trade)) { trade = "HIS4.Biz."; } if (checkBox2.Checked) { try { File.WriteAllText(Application.StartupPath + "\\test.log", richTextBox1.Text, Encoding.UTF8); var xmldom = new XmlDocument(); xmldom.LoadXml(richTextBox1.Text); using (var channelFactory = new SRR.HisApplayClient()) { var tradetype = trade + xmldom.LastChild.Name.Replace("_IN", ""); string outxml = ""; var out1 = channelFactory.RunService(tradetype, richTextBox1.Text, ref outxml); if (checkBox1.Checked) { richTextBox2.Clear(); } richTextBox2.AppendText(outxml); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { try { File.WriteAllText(Application.StartupPath + "\\test.log", richTextBox1.Text, Encoding.UTF8); var xmldom = new XmlDocument(); xmldom.LoadXml(richTextBox1.Text); using (var channelFactory = new SR.HisApplayClient()) { var tradetype = trade + xmldom.LastChild.Name.Replace("_IN", ""); var outxml = ""; var i = channelFactory.RunService(tradetype, richTextBox1.Text, ref outxml); if (checkBox1.Checked) { richTextBox2.Clear(); } richTextBox2.AppendText(outxml); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } }