public string saveTipoOrdineGiorno(Azienda azienda, DettaglioTabellaSempliceDTO elemento, Gipasoft.Sfera.Enums.CRUDOperation operation, IDaoFactory daoFactory) { try { var message = string.Empty; TipoOrdineDelGiorno item; if (elemento.Id > 0) item = daoFactory.GetTipoOrdineDelGiornoDao().Find(elemento.Id, false); else { item = new TipoOrdineDelGiorno(elemento.Descrizione); daoFactory.GetTipoOrdineDelGiornoDao().SaveOrUpdate(item); } if (item != null) { if (operation == Gipasoft.Sfera.Enums.CRUDOperation.Update) { item.Descrizione = elemento.Descrizione; item.Azienda = azienda; } else if (operation == Gipasoft.Sfera.Enums.CRUDOperation.Delete) daoFactory.GetTipoOrdineDelGiornoDao().Delete(item); } return message; } catch (Exception ex) { _log.Error("Errore nel salvataggio delle tipologie ordine del giorno: " + Utility.GetMethodDescription() + " - id:" + elemento.Id, ex); throw; } }