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) }); }
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) }); }
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) }); }