/// <summary> /// Deletes the printer. /// </summary> /// <param name="printer">The printer to delete.</param> /// <returns></returns> public static bool DeletePrinter(Printer printer) { bool success = false; try { if (printer != null) { DataAccessProvider dataAccessProvider = DataAccessProvider.Instance(); if (dataAccessProvider != null) { success = dataAccessProvider.DeletePrinter(printer.Id); } else { Exception ex = new DataProviderException("Null Provider Instance"); if (ExceptionPolicy.HandleException(ex, "Business Logic")) { throw ex; } } } } catch (Exception ex) { if (ExceptionPolicy.HandleException(ex, "Business Logic")) { throw; } } return(success); }
internal AccountErrorEventArgs(DataProviderException error) { Error = error; }
private void OnAccountLoadingError(DataProviderException error) { EventHandler <AccountErrorEventArgs> eventHandler = AccountLoadingError; eventHandler?.Invoke(this, new AccountErrorEventArgs(error)); }