private void DTime_DatumRodenja_Validating(object sender, CancelEventArgs e) { if (DTime_DatumRodenja.Value < DTime_DatumRodenja.MinDate) { ErrorProvider_Validation.SetError(DTime_DatumRodenja, Properties.Resources.DateSmallerThanPossible); } else { ErrorProvider_Validation.SetError(DTime_DatumRodenja, null); } }
private void CBox_Uloge_Validating(object sender, CancelEventArgs e) { var Item = CBox_Uloge.SelectedItem as KorisnikUloga; if (Item.Id == 0) { ErrorProvider_Validation.SetError(CBox_Uloge, Properties.Resources.RequiredField); } else { ErrorProvider_Validation.SetError(CBox_Uloge, null); } }
private void CBox_Pojas_Validating(object sender, CancelEventArgs e) { var Item = CBox_Pojas.SelectedItem as Pojas; if (Item.Id == 0) { ErrorProvider_Validation.SetError(CBox_Pojas, Properties.Resources.RequiredField); } else { ErrorProvider_Validation.SetError(CBox_Pojas, null); } }
private void TBox_Kategorija_Validating(object sender, CancelEventArgs e) { Regex Regex = new Regex("-([0 - 9]{ 1, 3 })(.)([0 - 9]{ 0,3})kg"); if (String.IsNullOrWhiteSpace(TBox_Kategorija.Text)) { ErrorProvider_Validation.SetError(TBox_Kategorija, Properties.Resources.RequiredField); e.Cancel = true; } else { ErrorProvider_Validation.SetError(TBox_Kategorija, null); } }
private void TBox_Kilaza_Validating(object sender, CancelEventArgs e) { Regex OnlyNumerical = new Regex(@""); if (String.IsNullOrWhiteSpace(TBox_Kilaza.Text)) { ErrorProvider_Validation.SetError(TBox_Kilaza, Properties.Resources.RequiredField); e.Cancel = true; } else { ErrorProvider_Validation.SetError(TBox_Kilaza, null); } }
private void TBox_Prezime_Validating(object sender, CancelEventArgs e) { if (String.IsNullOrWhiteSpace(TBox_Prezime.Text)) { ErrorProvider_Validation.SetError(TBox_Prezime, Properties.Resources.RequiredField); e.Cancel = true; } else if (TBox_Prezime.Text.Length <= 1) { ErrorProvider_Validation.SetError(TBox_Prezime, Properties.Resources.TooShortField); e.Cancel = true; } else { ErrorProvider_Validation.SetError(TBox_Prezime, null); } }