private void OnValidatingNotificationReceived(object sender, ValidatingEventArgs eventArgs)
 {
     if (Dirty)
     {
         SyncDataToBudgetService();
     }
 }
 protected virtual void OnValidatingField(ValidatingEventArgs e)
 {
     if (ValidatingUI != null)
     {
         ValidatingUI(this, e);
     }
 }
Example #3
0
 /// <summary>
 /// Validate the DateTimeText
 /// </summary>
 void DateRange_Validating(SfDateTimeEdit sender, ValidatingEventArgs args)
 {
     if (args.IsError)
     {
         args.Cancel = true;
     }
 }
        public bool ValidateModel(StringBuilder messages)
        {
            EventHandler <ValidatingEventArgs> handler = Validating;
            var args = new ValidatingEventArgs();

            handler?.Invoke(this, args);

            return(Budgets.Validate(messages));
        }
Example #5
0
 private void _model_validating(object sender, ValidatingEventArgs e)
 {
     if (!(_includeindividuals.Value || _includeorganizations.Value || _includegroups.Value))
     {
         e.Valid            = false;
         e.InvalidFieldName = _includeindividuals.Name;
         e.InvalidReason    = "You must select at least one constituent type.";
     }
 }
Example #6
0
 /// <summary>
 /// Fires DAORecordSetHelper Validating event that is listened by DAODataControlHelper
 /// </summary>
 /// <param name="Action"></param>
 /// <param name="Save"></param>
 protected virtual void OnValidating(ref int Action, ref int Save)
 {
     if (Validating != null)
     {
         ValidatingEventArgs vArgs = new ValidatingEventArgs(Action, Save);
         Validating(this, vArgs);
         Action = vArgs.Action;
         Save   = vArgs.Save;
     }
 }
Example #7
0
        private void OnCellValidating(object sender, ValidatingEventArgs e)
        {
            var grid       = this.Model.GridView as RadDataGrid;
            var validation = sender as ValidationControl;

            if (grid != null && validation != null)
            {
                this.RaiseValidateCommands(grid, new ValidateCellContext(e.Errors, new DataGridCellInfo(validation.DataItem, this)));
            }
        }
Example #8
0
 /// <summary>
 /// Validates the value in the data form fields.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="e">Event arguments of OnValidating event.</param>
 private void OnValidating(object sender, ValidatingEventArgs e)
 {
     if (e.PropertyName.Equals("ContactNumber"))
     {
         if (e.Value != null && e.Value.ToString().Length > 10)
         {
             e.ErrorMessage = "Phone number should not exceed 10 digits.";
             e.IsValid      = false;
         }
     }
 }
Example #9
0
 private void UMHSInteractionCopyUIModel_Validating(object sender, ValidatingEventArgs e)
 {
     if (this.INTERACTIONS.Value.Count > 0)
     {
         var prompt = new UIPrompt();
         prompt.Text        = "Copy iteraction complete";
         prompt.ButtonStyle = UIPromptButtonStyle.Ok;
         prompt.ImageStyle  = UIPromptImageStyle.Information;
         this.Prompts.Add(prompt);
     }
 }
        private void ValidatingFieldHandler(object sender, CancelEventArgs e)
        {
            ValidatingEventArgs vea = new ValidatingEventArgs();

            OnValidatingField(vea);
            e.Cancel = vea.Cancel;
            if (vea.Cancel)
            {
                MessageBox.Show(vea.ValidationMessage, "Error");
            }
        }
        private void PhoneAddFormUIModel_Validating(object sender, ValidatingEventArgs e)
        {
            if (this.ISPRIMARY.Value)
            {
                this.ENDDATE.Value = DateTime.MinValue;
            }
            ValidatingEventArgs validatingEventArgs1 = e;
            ValidatingEventArgs validatingEventArgs2 = e;
            string invalidReason = validatingEventArgs2.InvalidReason;

            validatingEventArgs2.InvalidReason = invalidReason;
        }
Example #12
0
        public ICollection <ValidationResult>[] GetValidationResultCollections()
        {
            List <ICollection <ValidationResult> > list = new List <ICollection <ValidationResult> >();

            List <ExecutionEntry <T> > context = new List <ExecutionEntry <T> >();

            foreach (ExecuteAggregation <T> executeAggregation in ExecuteAggregations)
            {
                Execution execution = GetExecution(executeAggregation);
                context.Add(new ExecutionEntry <T>(execution, executeAggregation.Aggreg, executeAggregation.Entity, executeAggregation.Schema));
            }

            foreach (ExecuteAggregation <T> executeAggregation in ExecuteAggregations)
            {
                List <ValidationResult> validationResults = new List <ValidationResult>();

                foreach (ExecuteCommand <T> executeCommand in executeAggregation.ExecuteCommands)
                {
                    if (executeCommand is UpdateCommandNode <T> )
                    {
                        validationResults.AddRange(GetValidationResults(executeCommand as UpdateCommandNode <T>));
                    }
                    else
                    {
                        if (executeCommand is InsertCommand <T> )
                        {
                            validationResults.AddRange(GetAnnotationValidationResults(executeCommand as InsertCommand <T>));
                        }
                        else if (executeCommand is DeleteCommand <T> )
                        {
                        }
                        else if (executeCommand is UpdateCommand <T> )
                        {
                            validationResults.AddRange(GetAnnotationValidationResults(executeCommand as UpdateCommand <T>));
                        }
                    }
                }

                //
                ValidatingEventArgs <T> args = new ValidatingEventArgs <T>(GetExecution(executeAggregation), executeAggregation.Aggreg, executeAggregation.Entity, executeAggregation.Schema, context);
                OnValidating(args);

                validationResults.AddRange(args.ValidationResults.Where(r => r != ValidationResult.Success));

                if (validationResults.Count > 0)
                {
                    list.Add(validationResults);
                }
            }

            return(list.ToArray());
        }
 private void ValidatingFieldHandler(object sender, CancelEventArgs e)
 {
     if (!_suspendEvent)
     {
         _suspendEvent = true;
         ValidatingEventArgs vea = new ValidatingEventArgs();
         OnValidatingField(vea);
         e.Cancel = vea.Cancel;
         if (vea.Cancel)
         {
             MessageBox.Show(vea.ValidationMessage, "Error");
         }
         _suspendEvent = false;
     }
 }
Example #14
0
        private void DataForm_Validating(object sender, ValidatingEventArgs e)
        {
            int height = (dataForm.DataObject as Info).Height;
            int weight = (dataForm.DataObject as Info).Weight;

            if (height >= 140 && weight >= 40)
            {
                bmi = Convert.ToInt32(weight / Math.Pow(height / 100.0, 2));
                if (bmi > 40 || bmi < 16)
                {
                    Application.Current.MainPage.DisplayAlert("Sorry to say that...", "You need to visit specialist, we can't help you :(", "OK");
                    (dataForm.DataObject as Info).Height = 0;
                    (dataForm.DataObject as Info).Weight = 0;
                }
            }
        }
 private void _pointsToCalulateTb_Validating(object sender, CancelEventArgs e)
 {
     if (!_suspendEvents)
     {
         if (ValidatingUI != null)
         {
             ValidatingEventArgs ve = new ValidatingEventArgs();
             ValidatingUI(this, ve);
             e.Cancel = ve.Cancel;
             if (e.Cancel)
             {
                 MessageBox.Show(ve.ValidationMessage, "Error");
             }
         }
     }
 }
        public bool ValidateModel(StringBuilder messages)
        {
            EventHandler<ValidatingEventArgs> handler = Validating;
            var args = new ValidatingEventArgs();
            handler?.Invoke(this, args);

            return Budgets.Validate(messages);
        }
Example #17
0
 /// <summary>
 /// Fires DAORecordSetHelper Validating event that is listened by DAODataControlHelper
 /// </summary>
 /// <param name="Action"></param>
 /// <param name="Save"></param>
 protected virtual void OnValidating(ref int Action, ref int Save)
 {
     if (Validating != null)
     {
         ValidatingEventArgs vArgs = new ValidatingEventArgs(Action, Save);
         Validating(this, vArgs);
         Action = vArgs.Action;
         Save = vArgs.Save;
     }
 }
Example #18
0
 private void OnValidatingNotificationReceived(object sender, ValidatingEventArgs eventArgs)
 {
     if (Dirty) SyncDataToBudgetService();
 }
Example #19
0
 protected virtual void OnValidating(ValidatingEventArgs <T> args)
 {
     Validating?.Invoke(this, args);
 }