/// <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);
        }
Exemple #2
0
 internal AccountErrorEventArgs(DataProviderException error)
 {
     Error = error;
 }
Exemple #3
0
        private void OnAccountLoadingError(DataProviderException error)
        {
            EventHandler <AccountErrorEventArgs> eventHandler = AccountLoadingError;

            eventHandler?.Invoke(this, new AccountErrorEventArgs(error));
        }