using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UAS_MES_NEW.Entity;
using UAS_MES_NEW.DataOperate;

namespace UAS_MES_NEW.CustomControl.CustomCheckBox
{
    public partial class AutoPrintCheckBox : UserControl
    {
         
        public AutoPrintCheckBox()
        {
            InitializeComponent();
            this.Load += AutoPrintCheckBox_Load;
        }

        DataHelper dh;

        private void AutoPrintCheckBox_Load(object sender, EventArgs e)
        {
            dh = SystemInf.dh;
            if (FindForm().Tag != null)
            {
                if (dh.getFieldDataByCondition("CS$SYSNAVATION", "nvl(sn_defaultprint,0)", "sn_caller='" + FindForm().Tag.ToString() + "'").ToString() != "0")
                    AutoPrint.Checked = true;
                else
                    AutoPrint.Checked = false;
            }
        }

        public bool Checked
        {
            get
            {
                return AutoPrint.Checked;
            }

            set
            {
                AutoPrint.Checked = value;
            }
        }

        public override string Text
        {
            get
            {
                return AutoPrint.Text;
            }

            set
            {
                AutoPrint.Text = value;
            }
        }
    }
}