Skocz do zawartości

Problem z usuwaniem zlecenia, z skojarzonym dokumentem

Polecane posty

Próbowałem usunąć zlecenie serwisowe, które miało skojarzony dokument proformy. Z tego co pamiętam, proformę utworzyłem z poziomu zlecenia, poprzez dodaj nowy dokument skojarzony. Komunika błędu nie mówi nic, nawet w raporcie, dopiero w samych logach, po przegrzebaniu, natrafiłem, że skojarzenie generuje błąd - zwykły śmiertelnik teko nie znajdzie. Usunięcie skojarzenia, pozwala potem bez problemu usunąć zlecenie.

image.png.0d5b20343904e966614e2bb68a816a6c.png

I jeszcze log, w razie czego:

<?xml version="1.0" encoding="utf-8"?>
<Exception>
  <Type>InsERT.Mox.DataAccess.DataAccessException</Type>
  <Time>2022-11-24 18:42:01</Time>
  <Description>Wystąpił błąd dostępu do danych.</Description>
  <Method>Void HandleChangesSaveRequest(System.Object, InsERT.Mox.Work.ChangesSaveRequestEventArgs)</Method>
  <HelpLink />
  <StackTrace>   w InsERT.Mox.DataAccess.EntityFramework.UnitOfWorkAwareObjectContext.HandleChangesSaveRequest(Object sender, ChangesSaveRequestEventArgs args)
   w InsERT.Mox.Work.UnitOfWork.RequestSaveChanges(Boolean saveRequestVetoed, Boolean changesWereSaved)
   w InsERT.Mox.Work.UnitOfWork.SaveChanges()
   w InsERT.Mox.UIFramework.BulkDeleteDialog.DeleteBusinessObject(UnitOfWork uow, IBusinessObject bussinesObj)
   w InsERT.Mox.UIFramework.BulkDeleteDialog.Operation(Object item, ViewModelBase settingsViewModel)</StackTrace>
  <InnerException>
    <Type>System.Data.Entity.Core.UpdateException</Type>
    <Time>2022-11-24 18:42:01</Time>
    <Description>An error occurred while updating the entries. See the inner exception for details.</Description>
    <Method>Int32 Update()</Method>
    <HelpLink />
    <StackTrace>   w System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
   w System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.&lt;&gt;c.&lt;Update&gt;b__21_0(UpdateTranslator ut)
   w System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update[T](T noChangesResult, Func`2 updateFunction)
   w System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update()
   w System.Data.Entity.Core.Objects.ObjectContext.&lt;SaveChangesToStore&gt;b__153_0()
   w System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   w System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)
   w System.Data.Entity.Core.Objects.ObjectContext.&lt;&gt;c__DisplayClass148_0.&lt;SaveChangesInternal&gt;b__0()
   w System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   w System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
   w System.Data.Entity.Core.Objects.ObjectContext.SaveChanges(SaveOptions options)
   w InsERT.Mox.DataAccess.EntityFramework.UnitOfWorkAwareObjectContext.HandleChangesSaveRequest(Object sender, ChangesSaveRequestEventArgs args)</StackTrace>
    <InnerException>
      <Type>System.Data.SqlClient.SqlException</Type>
      <Time>2022-11-24 18:42:01</Time>
      <Description>The DELETE statement conflicted with the REFERENCE constraint "FK_SkojarzenieZlecenieSerwisowe". The conflict occurred in database "Nexo_Demo_6", table "ModelDanychContainer.Skojarzenia", column 'GlowneZlecenieSerwisoweId'.
The statement has been terminated.</Description>
      <Method>Void OnError(System.Data.SqlClient.SqlException, Boolean, System.Action`1[System.Action])</Method>
      <HelpLink />
      <StackTrace>   w System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   w System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   w System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   w System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady)
   w System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   w System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task&amp; task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   w System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task&amp; task, Boolean&amp; usedCache, Boolean asyncWrite, Boolean inRetry)
   w System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean&amp; usedCache, Boolean asyncWrite, Boolean inRetry)
   w System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   w System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.&lt;&gt;c.&lt;NonQuery&gt;b__4_0(DbCommand t, DbCommandInterceptionContext`1 c)
   w System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   w System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext)
   w System.Data.Entity.Internal.InterceptableDbCommand.ExecuteNonQuery()
   w System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues)
   w System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()</StackTrace>
    </InnerException>
  </InnerException>
  <EnviromentStackTrace>   w System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   w System.Environment.get_StackTrace()
   w InsERT.Mox.Helpers.Logging.ExceptionFileSaver.StackTraceElement()
   w InsERT.Mox.Helpers.Logging.ExceptionFileSaver.SaveExceptionInFile(Exception ex, String file)
   w InsERT.Mox.Helpers.Logging.ExceptionFileSaver.Save(Exception exception, String&amp; exceptionFilePath)
   w InsERT.Mox.Helpers.Logging.Logger.LogException(Exception exception, String message)
   w InsERT.Mox.Helpers.Logging.LogHelper.LogException(Exception exception)
   w InsERT.Mox.UIFramework.BulkDeleteDialog.Operation(Object item, ViewModelBase settingsViewModel)
   w InsERT.Mox.UIFramework.BulkOperationDialog.DoWork()
   w InsERT.Mox.UIFramework.BulkOperationDialog.PrepareAndRunBackgroundWorker(Boolean newStart)
   w InsERT.Mox.UIFramework.BulkOperationDialog.Wykonaj()
   w InsERT.Mox.UIFramework.BulkOperationDialog.ExecuteButton_Click(Object sender, RoutedEventArgs e)
   w System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   w System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   w System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   w System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   w System.Windows.Controls.Primitives.ButtonBase.OnClick()
   w System.Windows.Controls.Button.OnClick()
   w System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   w System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   w System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   w System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   w System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   w System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   w System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   w System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   w System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   w System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   w System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   w System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   w System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   w System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   w System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   w System.Windows.Input.InputManager.ProcessStagingArea()
   w System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   w System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   w System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   w System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
   w System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
   w MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
   w MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   w System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   w System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   w System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   w MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   w MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG&amp; msg)
   w System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   w System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   w System.Windows.Window.ShowHelper(Object booleanBox)
   w System.Windows.Window.Show()
   w System.Windows.Window.ShowDialog()
   w InsERT.Moria.Startup.UI.NexoAppBase.Go()
   w InsERT.Moria.Gestor.GestorApp.Main(String[] args)</EnviromentStackTrace>
</Exception>

 

Link to postu
  • 4 tygodnie później...
×
×
  • Dodaj nową pozycję...