Пример #1
0
 private void txtRate_Validating(object sender, CancelEventArgs e)
 {
     if (txtRate.Text != "")
     {
         if (VoucherBatchManage.IsNumber(txtRate.Text) == false)
         {
             MessageBox.Show("请输入符合的数字", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txtRate.Clear();
             txtRate.DataBindings.Clear();
             txtRate.DataBindings.Add("Text", dataBindingSource, "TaxRate", true);
             txtRate.Focus();
             return;
         }
     }
     else
     {
         txtRate.Text = "0";
     }
 }
Пример #2
0
 private void txtLowestPrice_Validating(object sender, CancelEventArgs e)
 {
     if (txtLowestPrice.Text == "" || txtLowestPrice.Text.Trim() == "0")
     {
         MessageBox.Show("影片最低票价不能为空或0!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     else
     {
         if (VoucherBatchManage.IsNumber(txtLowestPrice.Text) == false)
         {
             MessageBox.Show("影片最低票价请输入整数", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             //txtLowestPrice.Clear();
             //txtLowestPrice.DataBindings.Clear();
             //txtLowestPrice.DataBindings.Add("Text", dataBindingSource, "LowestPrice", true);
             //txtLowestPrice.Focus();
             return;
         }
     }
 }
Пример #3
0
 private void txtRatio_Validating(object sender, CancelEventArgs e)
 {
     if (txtRatio.Text != "")
     {
         if (VoucherBatchManage.IsNumber(txtRatio.Text) == false)
         {
             MessageBox.Show("片方分账比例请输入数字", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             //        txtRatio.Clear();
             //        txtRatio.DataBindings.Clear();
             //        txtRatio.DataBindings.Add("Text", dataBindingSource, "Ratio", true);
             //        txtRatio.DataBindings["Text"].Format += TextBox_Percent_Format;
             //        txtRatio.DataBindings["Text"].Parse += TextBox_Percent_Parse;
             //        txtRatio.Focus();
             //        return;
         }
     }
     //else
     //{
     //    txtRatio.Text = "0";
     //}
 }
Пример #4
0
 private void txtFilmLength_Validating(object sender, CancelEventArgs e)
 {
     if (txtFilmLength.Text != "")
     {
         if (VoucherBatchManage.IsIntegerNumber(txtFilmLength.Text) == false)
         {
             MessageBox.Show("片长请输入整数", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             //txtFilmLength.Clear();
             //txtFilmLength.DataBindings.Clear();
             //txtFilmLength.DataBindings.Add("Text", dataBindingSource, "FilmLength", true);
             //txtFilmLength.Focus();
             return;
         }
     }
     else
     {
         MessageBox.Show("请输入符合的数字", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtFilmLength.Focus();
         return;
     }
 }
Пример #5
0
 private void txtGroupPrice_Validating(object sender, CancelEventArgs e)
 {
     if (txtGroupPrice.Text != "")
     {
         txtGroupPrice.Text = txtGroupPrice.Text.Replace("元", string.Empty);
         if (VoucherBatchManage.IsNumber(txtGroupPrice.Text) == false)
         {
             MessageBox.Show("请输入整数", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txtGroupPrice.DataBindings.Clear();
             txtGroupPrice.DataBindings.Add("Text", dataBindingSource, "GroupPrice", true);
             txtGroupPrice.DataBindings["Text"].Format += TextBox_Currency_Format;
             txtGroupPrice.DataBindings["Text"].Parse  += TextBox_Currency_Parse;
             txtGroupPrice.Clear();
             txtGroupPrice.Focus();
             return;
         }
     }
     else
     {
         txtGroupPrice.Text = "0";
     }
 }
Пример #6
0
 private void txtLevels_Validating(object sender, CancelEventArgs e)
 {
     if (txtLevels.Text != "")
     {
         txtLevels.Text = txtLevels.Text.Replace("层", string.Empty);
         if (VoucherBatchManage.IsIntegerNumber(txtLevels.Text) == false)
         {
             MessageBox.Show("请输入整数", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txtLevels.DataBindings.Clear();
             txtLevels.DataBindings.Add("Text", dataBindingSource, "Levels", true);
             txtLevels.DataBindings["Text"].Format += TextBox_Currency_Format1;
             txtLevels.DataBindings["Text"].Parse  += TextBox_Currency_Parse1;
             txtLevels.Clear();
             txtLevels.Focus();
             return;
         }
     }
     else
     {
         MessageBox.Show("请输入符合的数字", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtLevels.Focus();
         return;
     }
 }