Form1.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using _08_2_WsClient.ServiceReference1;
  2. using _Log;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. namespace _08_2_WsClient
  13. {
  14. public partial class Form1 : Form
  15. {
  16. Log log;
  17. public Form1()
  18. {
  19. InitializeComponent();
  20. log = new Log(textBox1);
  21. }
  22. MyWSSoapClient client = new MyWSSoapClient();
  23. private void button1_Click(object sender, EventArgs e)
  24. {
  25. label1.Text = client.HelloWorld();
  26. }
  27. private void button2_Click(object sender, EventArgs e)
  28. {
  29. double[] doublesy = client.HelloDoubles();
  30. foreach (double d in doublesy)
  31. log.l($"{d}");
  32. }
  33. private void button3_Click(object sender, EventArgs e)
  34. {
  35. Document document = client.HelloDocument();
  36. log.l($"Name: {document.Name}");
  37. log.l($"Author: {document.Author}");
  38. log.l($"DataWydania: {document.DataWydania}");
  39. log.l($"Doublesy: {string.Join(", ", document.Doublesy)}");
  40. log.l($"Stron: {document.Stron}");
  41. }
  42. private void button4_Click(object sender, EventArgs e)
  43. {
  44. DataTable t = client.HelloDataTable();
  45. dataGridView1.DataSource = t;
  46. }
  47. private void button5_Click(object sender, EventArgs e)
  48. {
  49. DataTable t = dataGridView1.DataSource as DataTable;
  50. label1.Text = client.UpdateDataTable(t);
  51. }
  52. }
  53. }