frmNotifyCustomer.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using LYFZ.Model;
  6. namespace LYFZ.Software.MainBusiness.NewCameraControlBook
  7. {
  8. public class frmNotifyCustomer : LYFZ.Software.NewCameraControlBook.frmNotifyCustomer
  9. {
  10. public frmNotifyCustomer()
  11. {
  12. this.Load += FrmNotifyCustomer_Load;
  13. this.Shown += FrmNotifyCustomer_Shown;
  14. this.buttonEx2.Click += new System.EventHandler(this.buttonEx2_Click);
  15. this.buttonEx1.Click += new System.EventHandler(this.buttonEx1_Click);
  16. }
  17. private void FrmNotifyCustomer_Shown(object sender, EventArgs e)
  18. {
  19. this.txtInfo.Text = this.CustomerText.Trim();
  20. this.cbxTypeList.SelectedItem = this.NotifyType.ToString();
  21. }
  22. LYFZ.Model.NotifyCustomerType _NotifyType = Model.NotifyCustomerType.未通知;
  23. string _CustomerText = "";
  24. public NotifyCustomerType NotifyType { get => _NotifyType; set => _NotifyType = value; }
  25. public string CustomerText { get => _CustomerText; set => _CustomerText = value; }
  26. private void FrmNotifyCustomer_Load(object sender, EventArgs e)
  27. {
  28. this.cbxTypeList.Items.AddRange(Enum.GetNames(typeof(LYFZ.Model.NotifyCustomerType)));
  29. }
  30. private void buttonEx2_Click(object sender, EventArgs e)
  31. {
  32. this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  33. }
  34. private void buttonEx1_Click(object sender, EventArgs e)
  35. {
  36. this.CustomerText = this.txtInfo.Text.Trim();
  37. this.NotifyType =(LYFZ.Model.NotifyCustomerType)Enum.Parse(typeof(LYFZ.Model.NotifyCustomerType), this.cbxTypeList.SelectedItem.ToString());
  38. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  39. }
  40. }
  41. }