Form1.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using TempDbToUfida.OpenApi;
  11. using WangToTempDb;
  12. namespace YlInit
  13. {
  14. public partial class Form1 : Form
  15. {
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. }
  20. private void process_Click(object sender, EventArgs e)
  21. {
  22. Button b = (Button)sender;
  23. IProcess process = null;
  24. switch (b.Tag.ToString())
  25. {
  26. case "Inventory":
  27. process = new Inventory();
  28. break;
  29. case "Warehouse":
  30. process = new Warehouse();
  31. break;
  32. case "Vendor":
  33. process = new Vendor();
  34. break;
  35. case "Stock":
  36. process = new Stock();
  37. break;
  38. default:
  39. break;
  40. }
  41. try
  42. {
  43. process.Process();
  44. MessageBox.Show("初始化成功");
  45. b.Enabled = false;
  46. }
  47. catch (Exception ex)
  48. {
  49. MessageBox.Show(ex.Message);
  50. }
  51. }
  52. }
  53. }