Ejemplo n.º 1
0
 //添加
 private void ButAdd_Click(object sender, EventArgs e)
 {
     try
     {
         qCDrumsFindLeakReportBindingSource.EndEdit();//获取文本框数据
         if (model.FLResult.IsNullOrEmpty())
         {
             FLResultTextEdit.Focus();
             ClsMsg.ShowWarningEmptyMsg(ItemForFLResult.Text);
         }
         else if (model.Frequency.IsNullOrEmpty())
         {
             FrequencyTextEdit.Focus();
             ClsMsg.ShowWarningEmptyMsg(ItemForFrequency.Text);
         }
         else if (model.DevName.IsNullOrEmpty())
         {
             ClsMsg.ShowWarningEmptyMsg(ItemForDrumsName.Text);
         }
         else if (model.FLSituation.IsNullOrEmpty())
         {
             FLSituationTextEdit.Focus();
             ClsMsg.ShowWarningEmptyMsg(ItemForFLSituation.Text);
         }
         else if (model.FLResult.Equals("合格") || ClsMsg.ShowQuestionMsg("当前检漏结果为:不合格!\r\n是否继续提交呢?") == DialogResult.Yes)
         {
             BgWait.RunWorkerAsync("SaveData");
         }
     }
     catch (Exception ex)
     {
         Utils.Logger.Error(ex.ToString());
         ClsMsg.ShowErrMsg(ex.Message);
     }
 }
Ejemplo n.º 2
0
        private void btn_Submit_Click(object sender, EventArgs e)
        {
            // mainPipelineInfoBindingSource.DataSource = Model;
            OperatingTimeTextEdit.Text = DateTime.Now.ToString();
            CreateDateDateEdit.Text    = DateTime.Now.ToString();

            if (string.IsNullOrEmpty(DeveCodeTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForDeveCode.Text);
                DeveCodeTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(DeveNameTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForDeveName.Text);
                DeveNameTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(PipelineStatusTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForPipelineStatus.Text);
                PipelineStatusTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(PromptDesTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForPromptDes.Text);
                PromptDesTextEdit.Focus();
            }
            //else if (string.IsNullOrEmpty(OperatorReamrkTextEdit.Text))
            //{
            //    ClsMsg.ShowWarningEmptyMsg(ItemForOperatorReamrk.Text);
            //    OperatorReamrkTextEdit.Focus();
            //}
            else if (string.IsNullOrEmpty(FrequencyTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForFrequency.Text);
                FrequencyTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(OperatorTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForOperator.Text);
                OperatorTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(CreatorTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForCreator.Text);
                CreatorTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(CreateDateDateEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForCreateDate.Text);
                CreateDateDateEdit.Focus();
            }
            else if (backgroundWorker.IsBusy == false)
            {
                if (ClsMsg.ShowQuestionMsg("是否保存当前操作?") == DialogResult.Yes)
                {
                    backgroundWorker.RunWorkerAsync("AddOperatingData");
                }
            }
        }
Ejemplo n.º 3
0
 private void simpleButton2_Click(object sender, EventArgs e)
 {
     qCFindLeakDrumsSetBindingSource.EndEdit();
     qCFindLeakDrumsSetDetailBindingSource.EndEdit();
     if (model.Frequency.IsNullOrEmpty())
     {
         ClsMsg.ShowWarningEmptyMsg(ForItemFrequency.Text);
         FrequencyTextEdit.Focus();
     }
     else if (detailList.Count == 0)
     {
         ClsMsg.ShowWarningMsg("未选择需要检漏转鼓信息,请选择转鼓");
     }
     else
     {
         bgwWait.RunWorkerAsync("SaveData");
     }
 }
Ejemplo n.º 4
0
        private void barManager1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                qCPullDetectionRegBindingSource.EndEdit();
                switch (e.Item.Name)
                {
                case "bbtniSave":

                    if (model.RegDate.ToString().IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForRegDate.Text);
                        RegDateDateEdit.Focus();
                    }
                    else if (model.QualityInspector.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForQualityInspector.Text);
                        QualityInspectorTextEdit.Focus();
                    }
                    else if (model.Frequency.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForFrequency.Text);
                        FrequencyTextEdit.Focus();
                    }
                    else if (model.ProductionLine.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForProductionLine.Text);
                        ProductionLineTextEdit.Focus();
                    }
                    else if (model.OrderCode.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForOrderCode.Text);
                        OrderCodeTextEdit.Focus();
                    }
                    else if (model.ProductLevel.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForProductLevel.Text);
                        ProductLevelComboBoxEdit.Focus();
                    }
                    else if (model.TestResults.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForTestResults.Text);
                        //TestResultsTextEdit.Focus();
                    }
                    else
                    {
                        if (ClsMsg.ShowQuestionMsg("是否要保存当前数据呢?") == DialogResult.Yes)
                        {
                            bgwWait.RunWorkerAsync("SaveData");
                        }
                    }
                    break;

                case "bbtniStart":
                    if (bbtniStart.Caption.Equals("开始检测"))
                    {
                        if (model.ProductLevel.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForProductLevel.Text);
                            ProductLevelComboBoxEdit.Focus();
                        }
                        else if (model.OrderType.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForOrderType.Text);
                        }
                        else if (model.Width.HasValue == false)
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForWidth.Text);
                        }
                        else if (model.Thick.HasValue == false)
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForThick.Text);
                        }
                        else if (dtPullRule == null || dtPullRule.Rows.Count == 0)
                        {
                            ClsMsg.ShowWarningMsg("请先维护拉力检测计算规则!");
                        }
                        else
                        {
                            iNum = 0;
                            bool bSuccess = mp.Open("COM7");
                            if (bSuccess)
                            {
                                timer1.Start();
                                bbtniStart.Caption = "停止检测";
                            }
                            else
                            {
                                ClsMsg.ShowWarningMsg(mp.modbusMsg);
                            }
                        }
                    }
                    else
                    {
                        timer1.Stop();
                        mp.Close();
                        //   model.ActualPull = 0;
                        //   model.TestResults = "aaa";
                        //   ItemCurrPull.Text = "0";
                        qCPullDetectionRegBindingSource.DataSource = model;
                        //#if DEBUG
                        //                            model.ActualPull = Convert.ToDecimal(textEdit1.Text);
                        //#endif


                        bbtniStart.Caption = "开始检测";
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                ClsMsg.ShowErrMsg(ex.Message);
                Utils.Logger.Error(ex.ToString());
            }
        }