Example #1
0
 private void SaveBinary(ClassDataQR qRData, string pathFile) // บันทึกข้อมูลลงไปในไฟล์ ไบนารี่
 {
     using (Stream stream = File.Open(pathFile, FileMode.Create))
     {
         var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
         binaryFormatter.Serialize(stream, qRData);
         stream.Close();
     }
 }
Example #2
0
        private void SaveXml(ClassDataQR qRData, string pathFile) //สร้างฟังชั่นสำหรับบันทึกข้อมูลลงไฟล์ XML
        {
            using (StreamWriter strWriter = new StreamWriter(pathFile, false))
            {
                var bs = new XmlSerializer(qRData.GetType()); //ใช้ข้อมูลจากคาสมาเขียน

                bs.Serialize(strWriter, qRData);
            }
        }
Example #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //classDataQRBindingSource.DataSource = QRData;
            // TODO: This line of code loads data into the 'dBxDataSet.FLData' table. You can move, or remove it, as needed.
            this.fLDataTableAdapter.FillBy1(this.dBxDataSet.FLData, Properties.Settings.Default.McNo);
            labelVer.Text        = Properties.Settings.Default.Version;
            menuStrip1.ForeColor = Color.White;

            string sourceFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "xmlData.txt");

            // button1.BackgroundImage = test2.Properties.Resources.PictureBoxButtonLotEndGreen; เปลี่ยนรูปพื้นหลัง
            if (File.Exists(sourceFile))
            {
                ClassDataQR classData = LoadXml(AppDomain.CurrentDomain.BaseDirectory + "/xmlData.txt");
                ClassLog.SaveLog("Restore Lot ", "Lot No.:" + classData.LotNo, classData.McNo, classData.EmpNo);
                if (classData.LotSetting.HasValue == true)
                {
                    labelStatus.Text        = "Status : Wait Start Lot";
                    button1.Enabled         = false;
                    button1.BackgroundImage = test2.Properties.Resources.input_gray;
                    buttonCancelLot.Visible = true;
                    pictureBox1.Visible     = true;
                    pictureBox2.Visible     = false;
                }
                if (classData.LotStart.HasValue == true)
                {
                    labelStatus.Text            = "Status : Lot Running";
                    buttonStart.Enabled         = false;
                    button1.Enabled             = false;
                    button1.BackgroundImage     = test2.Properties.Resources.input_gray;
                    buttonStart.BackgroundImage = test2.Properties.Resources.Start_gray;
                    buttonCancelLot.Visible     = false;
                    pictureBox1.Visible         = false;
                    pictureBox2.Visible         = true;
                }
                if (classData.LotClose.HasValue == true)
                {
                    labelStatus.Text             = "Status : Wait Setting Lot";
                    buttonLotEnd.Enabled         = false;
                    buttonStart.Enabled          = false;
                    buttonStart.BackgroundImage  = test2.Properties.Resources.Start_gray;
                    buttonLotEnd.BackgroundImage = test2.Properties.Resources.End_gray;
                    button1.Enabled         = true;
                    button1.BackgroundImage = test2.Properties.Resources.input_blue;
                    pictureBox1.Visible     = false;
                    pictureBox2.Visible     = false;
                    return;
                }
                QRData = classData;
            }
            classDataQRBindingSource.DataSource = QRData;
        }
Example #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            ClassDataQR classData = LoadXml(AppDomain.CurrentDomain.BaseDirectory + "/xmlData.txt");

            // ClassLog.SaveLog("Click Restore Lot Button", "Lot No.:" + classData.LotNo, classData.EmpNo);
            if (classData.LotStart.HasValue == true)
            {
                buttonStart.Enabled = false;
                button1.Enabled     = false;
            }
            if (classData.LotClose.HasValue == true)
            {
                MessageBox.Show("Lot End : " + classData.LotClose);
                buttonLotEnd.Enabled = false;
                buttonStart.Enabled  = false;
                button1.Enabled      = true;

                return;
            }
            QRData = classData;

            ShowData(QRData);
        }
Example #5
0
 private void ShowData(ClassDataQR dataQR)
 {
     classDataQRBindingSource.ResetBindings(true);
     classDataQRBindingSource.DataSource = QRData; //Binding data from class
 }
Example #6
0
 public Form1()
 {
     InitializeComponent();
     QRData         = new ClassDataQR();
     labelMcNo.Text = Properties.Settings.Default.McNo;
 }
Example #7
0
 public FormEmpEnd()
 {
     InitializeComponent();
     DataQR = new ClassDataQR();
 }
Example #8
0
 public FormEmpEnd(ClassDataQR data)
 {
     InitializeComponent();
     DataQR = data;
 }
Example #9
0
 public FormInpuQty(ClassDataQR dataQR)
 {
     InitializeComponent();
     DataQR = dataQR;
 }
Example #10
0
 public FormDataRecord(ClassDataQR qRData)
 {
     InitializeComponent();
     DataQR = qRData;
 }
Example #11
0
 public FormInpuQty()
 {
     InitializeComponent();
     DataQR = new ClassDataQR();
 }
Example #12
0
 public FormScanEmp(ClassDataQR dataQR)
 {
     DataQR = dataQR;
     InitializeComponent();
 }
Example #13
0
 public FormScanEmp()
 {
     InitializeComponent();
     DataQR = new ClassDataQR();
 }
Example #14
0
 public FormSetting(ClassDataQR dataQR)
 {
     InitializeComponent();
     DataQR = dataQR;
 }
Example #15
0
        //public string LotNo { get; set; }


        public FormSetting()
        {
            InitializeComponent();
            DataQR = new ClassDataQR();
        }