Esempio n. 1
0
 private void Edt_Spec_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
 {
     if (_LastSuccess && e.Button.Key.EndsWith("LAST"))
     {
         if (!Edt_Spec.Text.Equals(this._LastSpec))
         {
             Edt_Spec.Text = this._LastSpec;
             Edt_Spec.Focus();
         }
         else
         {
             Edt_Spec.Clear();
             Edt_Spec.Focus();
         }
     }
 }
Esempio n. 2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                string strSign = GetSign();
                if (string.IsNullOrEmpty(strSign))
                {
                    MessageBox.Show("产线未知,无法组批!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }

                if (cbx_BatchNo.Checked)
                {
                    if (string.IsNullOrEmpty(Edt_BatchNo.Text.Trim()))
                    {
                        MessageBox.Show("请输入轧制编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        Edt_BatchNo.SelectAll();
                        Edt_BatchNo.Focus();
                        return;
                    }

                    if (!BatchNoCheck(Edt_BatchNo.Text.Trim()))
                    {
                        MessageBox.Show("轧制编号不满足编码规则(" + strSign + " + 1位年份(\\d) + 2位月份[0-1]\\d + 4位流水号\\d\\d\\d\\d、如" + strSign + "2050001)!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        Edt_BatchNo.SelectAll();
                        Edt_BatchNo.Focus();
                        return;
                    }
                }

                if (string.IsNullOrEmpty(Edt_OrderNo.Text.Trim()))
                {
                    MessageBox.Show("请输入生产订单号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    Edt_OrderNo.SelectAll();
                    Edt_OrderNo.Focus();
                    return;
                }

                if (string.IsNullOrEmpty(Edt_Spec.Text.Trim()))
                {
                    MessageBox.Show("未指定轧制规格!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    Edt_Spec.SelectAll();
                    Edt_Spec.Focus();
                    return;
                }

                if (_PRODUCELINE != ProduceLine.GX)
                {
                    if (string.IsNullOrEmpty(Edt_Length.Text.Trim()))
                    {
                        MessageBox.Show("未指定定尺长度!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        Edt_Length.SelectAll();
                        Edt_Length.Focus();
                        return;
                    }

                    decimal dLen = 0.0M;

                    if (!(decimal.TryParse(Edt_Length.Text.Trim(), out dLen)))
                    {
                        MessageBox.Show("定尺长度必须是数值!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        Edt_Length.SelectAll();
                        Edt_Length.Focus();
                        return;
                    }

                    if (dLen <= 0)
                    {
                        MessageBox.Show("定尺长度必须大于零!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        Edt_Length.SelectAll();
                        Edt_Length.Focus();
                        return;
                    }
                }

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }