internal static NotificaDto GetNewNotifica(AziendaDto azienda, Tipi.TipoReport tipoReport, string applicazione) { try { if (azienda != null) { var notifica = new NotificaDto(); notifica.Applicazione = applicazione; notifica.Codice = "Id=Report"; notifica.Tipo = tipoReport.ToString(); notifica.Data = DateTime.Now; return notifica; } } catch (Exception ex) { UtilityError.Write(ex); } return null; }
internal static NotificaDto GetNewNotifica(FatturaVenditaDto fatturaVendita, string applicazione) { try { if (fatturaVendita != null) { var notifica = new NotificaDto(); notifica.Applicazione = applicazione; notifica.Codice = "Id=" + fatturaVendita.Id; notifica.Tipo = Tipi.TipoNotifica.FatturaVendita.ToString(); notifica.Data = DateTime.Now; return notifica; } } catch (Exception ex) { UtilityError.Write(ex); } return null; }
/// <summary> /// Deletes notifica from the database by the given dto object. /// </summary> /// <param name="notifica">The dto object.</param> public void DeleteNotifica(NotificaDto notifica) { this.NotificaService.Delete(notifica); this.UnitOfWork.SaveChanges(); }
/// <summary> /// Adds a new notifica from the given dto object into the database. /// </summary> /// <param name="notifica">The dto object.</param> /// <returns>The dto key of the newly created notifica.</returns> public string CreateNotifica(NotificaDto notifica) { string key = this.NotificaService.Add(notifica); this.UnitOfWork.SaveChanges(); return key; }