Exemplo n.º 1
0
        private void LogErrorToDebug(System.ServiceModel.DomainServices.Client.SubmitOperation so)
        {
            System.Diagnostics.Debug.WriteLine("ERROR: {0}", so.Error);

            foreach (var entity in so.EntitiesInError)
            {
                foreach (var error in entity.ValidationErrors)
                {
                    foreach (var memberNames in error.MemberNames)
                    {
                        System.Diagnostics.Debug.WriteLine("ERROR: {0} {1}...", error.ErrorMessage, memberNames);
                    }
                }
                if (entity.EntityConflict != null)
                {
                    foreach (var propertyName in entity.EntityConflict.PropertyNames)
                    {
                        System.Diagnostics.Debug.WriteLine("ERROR: {0} {1}...", entity, propertyName);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void ChangesSubmitted(System.ServiceModel.DomainServices.Client.SubmitOperation result)
        {
            if (result.HasError)
            {
                // Handle here...
                var error = result.Error as DomainOperationException;
                switch (error.Status)
                {
                case OperationErrorStatus.ValidationFailed:
                    result.MarkErrorAsHandled();
                    return;

                default:
                    break;
                }
            }
            else
            {
                if (CloseView != null)
                {
                    CloseView(this, EventArgs.Empty);
                }
            }
        }