bool _save_log_()
        {
            bool r = false;

            r = new io_msaccdb_tbDataLog().WriteData(); //save log to tb_datalog
            if (MyGlobal.MyTesting.TotalResult == "PASS")
            {
                r = new io_msaccdb_tbDataProductionLot().WriteData(); //write serial to tb_DataProductionLot
                r = new io_msaccdb_tbIMEISerialPrint().WriteData();   //write product to tbIMEISerialPrint
            }
            MyGlobal.MyTesting.ProductSerial = "";                    //clear product serial number
            return(r);
        }
Beispiel #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button b = sender as Button;

            if (MyGlobal.MyTesting.LotName == null || MyGlobal.MyTesting.LotName.Length != 14)
            {
                MessageBox.Show("Thông tin LOT chưa cài đặt.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }


            switch (b.Content)
            {
            case "Start Bulk Rework": {
                MyGlobal.MySetting.ProductionStatus = "BulkRework";

                //delete all data in table: IMEI_SN_Print, tb_DataProductionLOT_Bulk
                bool r = false;
                r = new io_msaccdb_tbIMEISerialPrint().DeleteAll();
                r = new io_msaccdb_tbDataProductionLot().DeleteAll();
                break;
            }

            case "End Bulk Rework": {
                MyGlobal.MySetting.ProductionStatus = "Normal";
                //delete all data in table: IMEI_SN_Print, tb_DataProductionLOT_Bulk
                bool r = false;
                r = new io_msaccdb_tbIMEISerialPrint().DeleteAll();
                break;
            }
            }

            //gen LOT
            bool flag_index_change = MyGlobal.MyTesting.LotCount == "0" ? false : true; //true = +1 vao chi so LOT, false = ko thay doi

            MyGlobal.MyTesting.LotCount = "0";
            MyGlobal.MyTesting.LotName  = new GenerateLOT(MyGlobal.MySetting.LineIndex, MyGlobal.MySetting.ProductionPlace, MyGlobal.MySetting.ProductionYear, MyGlobal.MySetting.ProductNumber, MyGlobal.MySetting.LOTIndex, flag_index_change).Gererate();
            //delete IMEI_SN_Print talbe
            new io_msaccdb_tbIMEISerialPrint().DeleteAll();

            //save setting
            XmlHelper <MyFunction.Custom.Proj_SettingInformation> .ToXmlFile(MyGlobal.MySetting, MyGlobal.Setting_FileFullName);
        }