コード例 #1
0
 private void txtProductionId_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (string.IsNullOrEmpty(txtProductionId.Text))
         {
             Ultils.TextControlNotNull(txtProductionId, "The Production ID required.");
         }
         else
         {
             var production = _oqcService.GetLogByProductionId(txtProductionId.Text);
             if (production != null)
             {
                 txtBoxId.Focus();
             }
             else
             {
                 Ultils.EditTextErrorMessage(txtProductionId, "The Production ID not exits.");
             }
         }
     }
     if (e.KeyCode == Keys.Tab)
     {
         if (string.IsNullOrEmpty(txtProductionId.Text))
         {
             Ultils.TextControlNotNull(txtProductionId, "The Production ID required.");
         }
     }
 }
コード例 #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
         {
             foreach (var item in _oqcService.GetModels())
             {
                 if (txtProductionID.Text.Trim().Contains(item.SerialNo) && txtProductionID.Text.Contains(item.ModelID))
                 {
                     lblQuantityModel.Visible      = true;
                     lblQuantityModel.Text         = $"/{item.Quantity}";
                     tableLayoutPanelModel.Visible = true;
                     lblCurentModel.Text           = item.ModelID;
                     lblSerialNo.Text = item.SerialNo;
                     break;
                 }
             }
             var production = _oqcService.GetLogByProductionId(txtProductionID.Text.Trim());
             if (production != null)
             {
                 //SetErrorStatus(true, "NG", $"Error!\nProduction ID[{txtProductionID.Text.Trim()}]\nĐã có trong hệ thống.\nVui lòng kiểm tra lại!");
                 SetErrorStatus(true, "NG",
                                $"PCB [{txtProductionID.Text}] đã có trong hệ thống.\nVui lòng kiểm tra lại\n" +
                                $"Box ID: {production.BoxID} " +
                                $"Operator: {production.OperatorCode} " +
                                $"Date Check: {production.DateCheck}");
                 txtProductionID.SelectAll();
                 Ultils.EditTextErrorNoMessage(txtProductionID);
             }
             else
             {
                 txtMacAddress.Focus();
                 SetErrorStatus(false, "OK", null);
             }
         }
     }
     if (e.KeyCode == Keys.Tab)
     {
         if (string.IsNullOrEmpty(txtProductionID.Text))
         {
             Ultils.TextControlNotNull(txtProductionID, "Production ID");
         }
     }
 }
コード例 #3
0
ファイル: FormMain.cs プロジェクト: imatary/work
 private void txtProductionID_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         _dateTimeCheck = DateTime.Now;
         if (string.IsNullOrEmpty(txtProductID.Text))
         {
             SetErrorStatus("NG", $"Label không được để trống!");
             Ultils.EditTextErrorNoMessage(txtProductID);
         }
         else
         {
             string productionId = txtProductID.Text.Trim();
             if (productionId.Length < 8)
             {
                 SetErrorStatus("NG", $"Error! Label không đúng định dạng!");
                 txtProductID.SelectAll();
                 Ultils.EditTextErrorNoMessage(txtProductID);
             }
             else
             {
                 if (Program.CurrentUser.OperationID == 1)
                 {
                     var production = _oqcService.GetLogByProductionId(productionId);
                     if (production != null)
                     {
                         SetErrorStatus("NG",
                                        $"PCB [{txtProductID.Text}] đã có trong hệ thống. Vui lòng kiểm tra lại\n" +
                                        $"Box ID: {production.BoxID}");
                         txtProductID.ResetText();
                         Ultils.EditTextErrorNoMessage(txtProductID);
                     }
                     else
                     {
                         InsertLog(txtBoxID.Text.Trim());
                     }
                 }
                 else if (Program.CurrentUser.OperationID >= 2)
                 {
                     InsertLog(txtBoxID.Text.Trim());
                 }
             }
         }
     }
 }
コード例 #4
0
ファイル: FormOQCNullModel.cs プロジェクト: imatary/work
 private void txtProductionID_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (string.IsNullOrEmpty(txtProductionID.Text))
         {
             SetErrorStatus(true, "NG", $"Production ID không được để trống!");
             Ultils.EditTextErrorNoMessage(txtProductionID);
         }
         else
         {
             string productionId = txtProductionID.Text.Trim();
             if (Program.CurrentUser.OperationID == 1)
             {
                 var production = _oqcService.GetLogByProductionId(productionId);
                 if (production != null)
                 {
                     SetErrorStatus(true, "NG",
                                    $"PCB [{txtProductionID.Text}] đã có trong hệ thống.\nVui lòng kiểm tra lại\n" +
                                    $"Box ID: {production.BoxID} \n" +
                                    $"Operator: {production.OperatorCode} \n" +
                                    $"Date Check: {production.DateCheck} \n");
                     txtProductionID.SelectAll();
                     Ultils.EditTextErrorNoMessage(txtProductionID);
                 }
                 else
                 {
                     SetErrorStatus(false, null, null);
                     InsertLog(txtBoxID.Text.Trim());
                 }
             }
             else if (Program.CurrentUser.OperationID >= 2)
             {
                 txtJudge.Focus();
                 SetErrorStatus(false, null, null);
             }
         }
     }
 }
コード例 #5
0
        private void txtProductionID_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                _dateTimeCheck = DateTime.Now;
                string productionId = txtProductionID.Text.Trim();
                if (string.IsNullOrEmpty(productionId))
                {
                    SetErrorStatus("NG", $"Production ID không được để trống!");
                    Ultils.EditTextErrorNoMessage(txtProductionID);
                }
                else
                {
                    if (productionId.Length <= 10)
                    {
                        SetErrorStatus("NG", $"Error!\nPCB không đúng định dạng!");
                        txtProductionID.SelectAll();
                        Ultils.EditTextErrorNoMessage(txtProductionID);
                    }
                    else
                    {
                        string currentModel = null;
                        if (productionId.Contains("_"))
                        {
                            string[] model = productionId.Split('_');
                            currentModel = model[1].Substring(0, 10);
                        }

                        var models = _modelService.GetModelLikeName(currentModel, FujiXerox);

                        if (checkFujiHP.Checked == true)
                        {
                            if ((models.ModelName == "105K 33480") || (models.ModelName == "105K 33470"))
                            {
                                quantity = models.QuantityHP;
                            }
                            else
                            {
                                SetErrorStatus("NG", $"Vui lòng kiểm tra lại");
                                checkFujiHP.Checked = false;
                            }
                        }
                        else
                        {
                            quantity = models.Quantity;
                        }

                        lblQuantityModel.Visible      = true;
                        lblQuantityModel.Text         = $"/{quantity}";
                        tableLayoutPanelModel.Visible = true;
                        lblCurentModel.Text           = models.ModelName;
                        lblSerialNo.Text     = models.SerialNo;
                        lblCustomerName.Text = $"Barcode {models.CustomerName}";
                        modelID = models.ModelID;

                        if (Program.CurrentUser.OperationID == 1)
                        {
                            var production = _oqcService.GetLogByProductionId(productionId);
                            if (production != null)
                            {
                                SetErrorStatus("NG",
                                               $"PCB [{txtProductionID.Text}] đã có trong hệ thống. Vui lòng kiểm tra lại\n" +
                                               $"Box ID: {production.BoxID}");
                                txtProductionID.ResetText();
                                Ultils.EditTextErrorNoMessage(txtProductionID);
                            }
                            else
                            {
                                SetErrorStatus("N/A", "no results");
                                InsertLog(txtBoxID.Text.Trim());
                            }
                        }
                        else if (Program.CurrentUser.OperationID >= 2)
                        {
                            SetErrorStatus("N/A", "no results");
                            InsertLog(txtBoxID.Text.Trim());
                        }
                    }
                }
            }
            if (e.KeyCode == Keys.Tab)
            {
                if (string.IsNullOrEmpty(txtProductionID.Text))
                {
                    SetErrorStatus("NG", $"Production ID không được để trống!");
                    Ultils.EditTextErrorNoMessage(txtProductionID);
                }
            }
        }
コード例 #6
0
ファイル: FormQACheck.cs プロジェクト: imatary/work
 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");
         }
     }
 }
コード例 #7
0
        private void txtProductionID_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                _dateTimeCheck = DateTime.Now;
                if (string.IsNullOrEmpty(txtProductID.Text))
                {
                    SetErrorStatus("NG", $"Label không được để trống!");
                    Ultils.EditTextErrorNoMessage(txtProductID);
                }
                else
                {
                    string productionId = txtProductID.Text.Trim();
                    if (productionId.Length <= 16)
                    {
                        SetErrorStatus("NG", $"Error! Label không đúng định dạng!");
                        txtProductID.SelectAll();
                        Ultils.EditTextErrorNoMessage(txtProductID);
                    }
                    else
                    {
                        if (productionId.Contains(lblCurentModel.Text) && productionId.Contains(lblSerialNo.Text))
                        {
                            if (Program.CurrentUser.OperationID == 1)
                            {
                                var production = _oqcService.GetLogByProductionId(productionId);
                                if (production != null)
                                {
                                    SetErrorStatus("NG",
                                                   $"PCB [{txtProductID.Text}] đã có trong hệ thống. Vui lòng kiểm tra lại\n" +
                                                   $"Box ID: {production.BoxID}");
                                    txtProductID.ResetText();
                                    Ultils.EditTextErrorNoMessage(txtProductID);
                                }
                                else
                                {
                                    bool _checkMes = false;
                                    var  checkMes  = _mesService.Get_WORK_ORDER_ITEMS_By_BoardNo(productionId);
                                    if (checkMes != null)
                                    {
                                        if (checkMes.BOARD_STATE > 1)
                                        {
                                            _checkMes = true;
                                        }
                                    }

                                    if (!_checkMes)
                                    {
                                        if (checkModelCUS.Checked == true)
                                        {
                                            txtModelCUS.Focus();
                                        }
                                        else
                                        {
                                            InsertLog(txtBoxID.Text.Trim());
                                        }
                                    }
                                    else
                                    {
                                        SetErrorStatus("NG", $"NG WIP. Vui lòng kiểm tra lại!");
                                        Ultils.EditTextErrorNoMessage(txtProductID);
                                    }
                                }
                            }
                            else if (Program.CurrentUser.OperationID >= 2)
                            {
                                InsertLog(txtBoxID.Text.Trim());
                            }
                        }
                        else
                        {
                            SetErrorStatus("NG", $"Sai Label. Vui lòng kiểm tra lại!");
                            Ultils.EditTextErrorNoMessage(txtProductID);
                        }
                    }
                }
            }
        }