Exemplo n.º 1
0
 private void ProizvodJelo_Validating(object sender, CancelEventArgs e)
 {
     if (ProizvodJelo.SelectedIndex == 0)
     {
         e.Cancel = true;
         KolicinaJelotextBox.Focus();
         errorProvider.SetError(ProizvodJelo, Messages.Univerzalno);
     }
     else
     {
         errorProvider.Clear();
     }
 }
Exemplo n.º 2
0
 private void KolicinaJelotextBox_Validating(object sender, CancelEventArgs e)
 {
     if (String.IsNullOrEmpty(KolicinaJelotextBox.Text))
     {
         e.Cancel = true;
         KolicinaJelotextBox.Focus();
         errorProvider.SetError(KolicinaJelotextBox, Messages.Integer);
         return;
     }
     else
     {
         if (!System.Text.RegularExpressions.Regex.IsMatch(KolicinaJelotextBox.Text, "\\d+"))
         {
             e.Cancel = true;
             KolicinaJelotextBox.Focus();
             errorProvider.SetError(KolicinaJelotextBox, Messages.Integer);
             return;
         }
     }
     errorProvider.Clear();
 }