AutoPrintCheckBox.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. try { UAS_MES_NEW.I18n.LanguageManager.Localize(this); } catch { }
  19. this.Load += AutoPrintCheckBox_Load;
  20. }
  21. DataHelper dh;
  22. private void AutoPrintCheckBox_Load(object sender, EventArgs e)
  23. {
  24. dh = SystemInf.dh;
  25. if (FindForm().Tag != null)
  26. {
  27. if (dh.getFieldDataByCondition("CS$SYSNAVATION", "nvl(sn_defaultprint,0)", "sn_caller='" + FindForm().Tag.ToString() + "'").ToString() != "0")
  28. AutoPrint.Checked = true;
  29. else
  30. AutoPrint.Checked = false;
  31. }
  32. }
  33. public bool Checked
  34. {
  35. get
  36. {
  37. return AutoPrint.Checked;
  38. }
  39. set
  40. {
  41. AutoPrint.Checked = value;
  42. }
  43. }
  44. public override string Text
  45. {
  46. get
  47. {
  48. return AutoPrint.Text;
  49. }
  50. set
  51. {
  52. AutoPrint.Text = value;
  53. }
  54. }
  55. }
  56. }