Пример #1
0
 private void RegisterControlsForValidation()
 {
     _validationManager = new ValidationManager()
     {
         Provider = _errorProvider
     };
     // Do not validate code because of auto generation
     //_validationManager.Validators.Add(new RequiredValidator()
     //{
     //    Control = txtCode,
     //    ErrorMessage = string.Format(CarsMaintenance.Properties.Resources.RequiredErrorMessage, lblCode.Text)
     //});
     _validationManager.Validators.Add(new RequiredValidator()
     {
         Control = cbSupply,
         ErrorMessage = string.Format(CarsMaintenance.Properties.Resources.RequiredErrorMessage, lblSupply.Text)
     });
     _validationManager.Validators.Add(new RequiredValidator()
     {
         Control = cbTool,
         ErrorMessage = string.Format(CarsMaintenance.Properties.Resources.RequiredErrorMessage, lblTool.Text)
     });
     _validationManager.Validators.Add(new DecimalValidator()
     {
         Control = txtQuantity,
         ErrorMessage = string.Format(CarsMaintenance.Properties.Resources.DigitalErrorMessage, lblQuantity.Text)
     });
     _validationManager.Validators.Add(new DecimalValidator()
     {
         Control = txtUnitPrice,
         ErrorMessage = string.Format(CarsMaintenance.Properties.Resources.DigitalErrorMessage, lblUnitPrice.Text)
     });
 }
Пример #2
0
 private void RegisterControlsForValidation()
 {
     _validationManager = new ValidationManager()
     {
         Provider = _errorProvider
     };
     _validationManager.Validators.Add(new RequiredValidator()
     {
         Control = txtCode,
         ErrorMessage = string.Format(CarsMaintenance.Properties.Resources.RequiredErrorMessage, lblCode.Text)
     });
     _validationManager.Validators.Add(new RequiredValidator()
     {
         Control = txtName,
         ErrorMessage = string.Format(CarsMaintenance.Properties.Resources.RequiredErrorMessage, lblName.Text)
     });
 }
Пример #3
0
 private void RegisterControlsForValidation()
 {
     _validationManager = new ValidationManager()
     {
         Provider = _errorProvider
     };
     // Do not validate code because of auto generation
     //_validationManager.Validators.Add(new RequiredValidator()
     //{
     //    Control = txtCode,
     //    ErrorMessage = string.Format(CarsMaintenance.Properties.Resources.RequiredErrorMessage, lblCode.Text)
     //});
     _validationManager.Validators.Add(new RequiredValidator()
     {
         Control = txtJob,
         ErrorMessage = string.Format(CarsMaintenance.Properties.Resources.RequiredErrorMessage, lblJob.Text)
     });
     _validationManager.Validators.Add(new RequiredValidator()
     {
         Control = cbCustomer,
         ErrorMessage = string.Format(CarsMaintenance.Properties.Resources.RequiredErrorMessage, lblCustomer.Text)
     });
 }