/// <summary> /// Gets all validation errors from the data list object and the criteria object, if any. /// </summary> /// <returns>Validation errors from the data list object and the criteria object.</returns> public override ErrorList GetValidationErrors() { ErrorList errLst = new ErrorList(); if (validationErrorList != null) { errLst.MergeWith(validationErrorList); } if (CriteriaObject != null) { errLst.MergeWith(CriteriaObject.GetValidationErrors()); } return(errLst); }
/// <summary> /// Gets all validation errors from the data object, all its properties and child objects recursively. /// </summary> /// <returns>Validation errors from the data object, all its properties and child objects.</returns> public virtual ErrorList GetValidationErrors() { ErrorList errLst = new ErrorList(); if (validationErrorList != null) { errLst.MergeWith(validationErrorList); } foreach (DataProperty p in properties.Values) { errLst.MergeWith(p.ValidationErrors); } foreach (DataObject obj in childObjects.Values) { errLst.MergeWith(obj.GetValidationErrors()); } return(errLst); }
/// <summary> /// Gets all validation errors from the data object, all its properties and child objects recursively. /// </summary> /// <returns>Validation errors from the data object, all its properties and child objects.</returns> public ErrorList GetValidationErrors() { ErrorList errLst = new ErrorList(); if (validationErrorList != null) errLst.MergeWith(validationErrorList); foreach (DataProperty p in properties.Values) errLst.MergeWith(p.ValidationErrors); foreach (IDataObject obj in childObjects.Values) errLst.MergeWith(obj.GetValidationErrors()); return errLst; }
protected override void LoadData() { ISalesOrderService svcSalesOrder = DI.Resolve<ISalesOrderService>(); ErrorList errorList = new ErrorList(); try { SalesOrder_ReadOutput outRead; using (TimeTracker.ServiceCall) outRead = svcSalesOrder.Read((int)obj.SalesOrderIdProperty.TransportValue); obj.FromDataContract(outRead); } catch(Exception ex) { errorList.MergeWith(ErrorList.FromException(ex)); } try { IEnumerable<SalesOrderDetail_ReadListOutput> outDetail_ReadList; using (TimeTracker.ServiceCall) outDetail_ReadList = svcSalesOrder.Detail_ReadList((int)obj.SalesOrderIdProperty.TransportValue); obj.DetailList.FromDataContract(outDetail_ReadList); } catch(Exception ex) { errorList.MergeWith(ErrorList.FromException(ex)); } if (svcSalesOrder is IDisposable) ((IDisposable)svcSalesOrder).Dispose(); errors.List.DataSource = errorList.Errors; errors.List.DataBind(); Page.DataBind(); }