AutoPrintCheckBox.cs 1.4 KB

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