/// <summary> /// Handles the EntityUpdating event of the ProductsDS control. /// Used to trap the entity fields errors at the current ProductEntity /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="SD.LLBLGen.Pro.ORMSupportClasses.CancelableDataSourceActionEventArgs"/> instance containing the event data.</param> protected void ProductsDS_EntityUpdating(object sender, CancelableDataSourceActionEventArgs e) { // the entity involved ProductEntity entityToEvaluate = (ProductEntity)e.InvolvedEntity; // Retrieve the fields errors from the entity. This will return a semicolon-separated list containing the info. string errors = entityToEvaluate.GetEntityFieldsErrors(); // there are errors, so cancel the update so the user can fix them. if (errors != string.Empty) { e.Cancel = true; ShowEntityErrors(errors); } else { HideEntityErrorControls(); } }