AutoPrintCheckBox.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Windows.Forms;
  3. using UAS_MES_NEW.DataOperate;
  4. using UAS_MES_NEW.Entity;
  5. namespace UAS_MES_NEW.CustomControl.CustomCheckBox
  6. {
  7. public partial class AutoPrintCheckBox : UserControl
  8. {
  9. public AutoPrintCheckBox()
  10. {
  11. InitializeComponent();
  12. this.Load += AutoPrintCheckBox_Load;
  13. }
  14. DataHelper dh;
  15. private void AutoPrintCheckBox_Load(object sender, EventArgs e)
  16. {
  17. dh = SystemInf.dh;
  18. if (FindForm().Tag != null)
  19. {
  20. if (dh.getFieldDataByCondition("CS$SYSNAVATION", "nvl(sn_defaultprint,0)", "sn_caller='" + FindForm().Tag.ToString() + "'").ToString() != "0")
  21. AutoPrint.Checked = true;
  22. else
  23. AutoPrint.Checked = false;
  24. }
  25. }
  26. public bool Checked
  27. {
  28. get
  29. {
  30. return AutoPrint.Checked;
  31. }
  32. set
  33. {
  34. AutoPrint.Checked = value;
  35. }
  36. }
  37. public override string Text
  38. {
  39. get
  40. {
  41. return AutoPrint.Text;
  42. }
  43. set
  44. {
  45. AutoPrint.Text = value;
  46. }
  47. }
  48. }
  49. }