private void offlineScaning(string _barcode) {
     try { 
         GenaricRepository<OprationBarcodes> _BarcodeRepository = new GenaricRepository<OprationBarcodes>(new ItrackContext());
         GenaricRepository<OprationBarcodes> _BarcodeEditRepository = new GenaricRepository<OprationBarcodes>(new ItrackContext());
         foreach (var barcode in _BarcodeRepository.GetAll().Where(p => p.OprationBarcodesID == _barcode).ToList())
         {
              OprationBarcodes _sbarcode = new OprationBarcodes();
             _sbarcode.OprationComplteAt =Convert.ToDateTime(txtDate.Text + " " +txtTime.Text);
             _sbarcode.isOparationComplete = true;
             _sbarcode.EmployeeID = _employee.EmployeeID;
             _sbarcode.OprationBarcodesID = this.BarcodeID;
             _sbarcode.OprationNO = barcode.OprationNO; ;
             _sbarcode.OparationName = barcode.OparationName;
             _sbarcode.OprationGrade = barcode.OprationGrade;
             _sbarcode.OprationRole = barcode.OprationRole;
             _sbarcode.BundleDetailsID = barcode.BundleDetails.BundleDetailsID;
             _sbarcode.PartName = barcode.PartName;
             _sbarcode.LineNo = barcode.LineNo;
             _sbarcode.StyleNo = barcode.StyleNo;
             _sbarcode.OprationBarcodesID = _barcode;
             _sbarcode.OperationPoolID = barcode.OprationNO;
             _BarcodeEditRepository.Update(_sbarcode);
         
         }
     }
     catch(Exception ex){
         Debug.WriteLine(ex.Message);
     }
 
 }
        private void UpdateOprationStatus() {
            try {
                GenaricRepository<OprationBarcodes> _BarcodeEditRepository = new GenaricRepository<OprationBarcodes>(new ItrackContext());
                OprationBarcodes _barcode = new OprationBarcodes();
                _barcode.OprationComplteAt = DateTime.Now;
                _barcode.isOparationComplete = true;
                _barcode.EmployeeID = txtEmployeeID.Text;
                _barcode.OprationBarcodesID = this.BarcodeID;
                _barcode.OprationNO = txtOperationNo.Text;
                _barcode.OparationName = txtOperationName.Text;
                _barcode.OprationGrade = this.Grade;
                _barcode.OprationRole = this.Role;
                _barcode.BundleDetailsID =Convert.ToInt16( txtBundleNo.Text);
                _barcode.PartName = txtPartName.Text;
                _BarcodeEditRepository.Update(_barcode);

            }
            catch(Exception ex){
                Debug.WriteLine(ex.Message);
            }
        }
        private void offlineScaning(string _barcode)
        {
            try
            {
                GenaricRepository<OprationBarcodes> _BarcodeRepository = new GenaricRepository<OprationBarcodes>(new ItrackContext());
                GenaricRepository<OprationBarcodes> _BarcodeEditRepository = new GenaricRepository<OprationBarcodes>(new ItrackContext());
                foreach (var barcode in _BarcodeRepository.GetAll().Where(p => p.OprationBarcodesID == _barcode).ToList())
                {
                  

                      OprationBarcodes _sbarcode = new OprationBarcodes();
                      _sbarcode.OprationComplteAt = Convert.ToDateTime(txtDate.Text + " " + txtScanTime.Text);
                      _sbarcode.isOparationComplete = true;
                      _sbarcode.EmployeeID = _employee.EmployeeID;
                      _sbarcode.OprationBarcodesID = this.BarcodeID;
                      _sbarcode.OprationNO = barcode.OprationNO; ;
                      _sbarcode.OparationName = barcode.OparationName;
                      _sbarcode.OprationGrade = barcode.OprationGrade;
                      _sbarcode.OprationRole = barcode.OprationRole;
                      _sbarcode.BundleDetailsID = barcode.BundleDetails.BundleDetailsID;
                      _sbarcode.PartName = barcode.PartName;
                      _sbarcode.LineNo = barcode.LineNo;
                      _sbarcode.StyleNo = barcode.StyleNo;
                      _sbarcode.OprationBarcodesID = _barcode;
                      _sbarcode.OperationPoolID = barcode.OprationNO;
                      _sbarcode.WorkstationNo = barcode.WorkstationNo;
                      _sbarcode.HourNo = txtHourNo.Text;
                      if (isEmployeeExist == true)
                      {
                          txtLog.MaskBox.AppendText("Barcode ID  -> :" + _barcode + "  - Operation No :" + _sbarcode.OprationNO + "  Operation Name:" + _sbarcode.OparationName + "\r\n");
                          _BarcodeEditRepository.Update(_sbarcode);

                      }
                      else
                      {
                          txtLog.MaskBox.AppendText("Employee Not exist : Barcode ID  -> :" + _barcode + "  - Operation No :" + _sbarcode.OprationNO + "  Operation Name:" + _sbarcode.OparationName + "\r\n");
                         
                      }
                  }
                    
                   
                    

              
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

        }