Пример #1
0
 private void txtorderid_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 27)
     {
         this.txtorder.Enabled = true;
         this.txtorder.SelectAll();
         this.txtorder.Focus();
     }
     if (e.KeyChar != 13)
     {
         return;
     }
     this.txtorderid.Text = this.txtorderid.Text.ToUpper();
     if (this.txtorderid.Text == "")
     {
         MessageBox.Show("请输入货主号");
         return;
     }
     customer = m.data.Find(delegate(Model.MgetCustomersByLcCodeBody v) { return(v.code == this.txtorderid.Text); });
     if (customer != null)
     {
         try
         {
             Cursor.Current = Cursors.WaitCursor;
             getNewOrder(customer.code);
             Cursor.Current = Cursors.Default;
         }
         catch (Exception ex)
         {
             Cursor.Current = Cursors.Default;
             MessageBox.Show(ex.Message);
             return;
         }
         this.Close();
     }
     else
     {
         MessageBox.Show("没有该货主编号");
         this.txtorderid.SelectAll();
         return;
     }
 }
Пример #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (!ischeck)
            {
                return;
            }
            int _int;

            _int = dataGrid1.CurrentCell.RowNumber;

            if (_int < 0)
            {
                return;
            }
            if (m != null)
            {
                if (_int > m.data.Count)
                {
                    return;
                }
                customer = m.data[_int];
                try
                {
                    Cursor.Current = Cursors.WaitCursor;
                    getNewOrder(customer.code);
                    Cursor.Current = Cursors.Default;
                }
                catch (Exception ex)
                {
                    Cursor.Current = Cursors.Default;
                    MessageBox.Show(ex.Message);
                    return;
                }
            }
            this.Close();
        }