Пример #1
0
 public void UpdateOQCCheck(tbl_test_log production, string operatorCode)
 {
     if (production != null)
     {
         production.QA_Check = true;
         production.CheckBy = operatorCode;
         production.DateCheck = DateTime.Now;
         try
         {
             _context.Entry(production).State = EntityState.Modified;
             _context.SaveChanges();
         }
         catch (Exception ex)
         {
             throw new Exception(ex.Message);
         }
     }
 }
Пример #2
0
 private void txtProductionID_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (string.IsNullOrEmpty(txtProductionID.Text))
         {
             Ultils.TextControlNotNull(txtProductionID, "Production ID");
         }
         else
         {
             string productionId = txtProductionID.Text.Trim();
             if (checkBox1.Checked == true)
             {
                 productionId = productionId.Replace("_", "");
                 txtProductionID.Text = productionId;
             }
             foreach (var item in _modelService.GetModels())
             {
                 if (productionId.Contains(item.ModelName.ToUpper()))
                 {
                     lblQuantityModel.Visible = true;
                     lblQuantityModel.Text = $"/{item.Quantity}";
                     tableLayoutPanelModel.Visible = true;
                     lblCurentModel.Text = item.ModelName;
                     lblSerialNo.Text = item.SerialNo;
                     break;
                 }
             }
             _log = _oqcService.GetLogByProductionId(productionId);
             if (_log != null)
             {
                 if (_log.QA_Check == false)
                 {
                     txtJudge.Focus();
                     SetErrorStatus(false, "OK", null);
                 }
                 else
                 {
                     SetSuccessStatus(true, "OK",
                     $"PCB [{productionId}] đã được kiểm tra rồi.\n" +
                     $"Box ID: {_log.BoxID} \n" +
                     $"Operator: {_log.OperatorCode} \n" +
                     $"Date Check: {_log.DateCheck} \n");
                     txtProductionID.SelectAll();
                     Ultils.EditTextErrorNoMessage(txtProductionID);
                 }
             }
             else
             {
                 SetErrorStatus(true, "NG", $"Production ID[{txtProductionID.Text.Trim()}]\nChưa có trong hệ thống. Vui lòng kiểm tra lại!");
                 txtProductionID.SelectAll();
                 Ultils.EditTextErrorNoMessage(txtProductionID);
             }
         }
     }
     if (e.KeyCode == Keys.Tab)
     {
         if (string.IsNullOrEmpty(txtProductionID.Text))
         {
             Ultils.TextControlNotNull(txtProductionID, "Production ID");
         }
     }
 }