示例#1
0
        public void SaveItem(int uid, string titolo, string sede, string persona, string indirizzo, string indirizzo2, string citta, string cap, string provincia, string telefono, string fax, string note, int categoriauid, int nazioneuid)
        {
            var item = Galleria.RetrieveByUId(uid);

            if (item == null)
            {
                throw new BONotFoundException <Galleria>(uid);
            }
            var categoria = GalleriaCategoria.RetrieveByUId(categoriauid);

            if (categoria == null)
            {
                throw new BONotFoundException <GalleriaCategoria>(categoriauid);
            }
            var nazione = Nazione.RetrieveByUId(nazioneuid);

            if (nazione == null)
            {
                throw new BONotFoundException <Nazione>(nazioneuid);
            }

            item.Titolo     = titolo;
            item.Sede       = sede;
            item.Persona    = persona;
            item.Indirizzo  = indirizzo;
            item.Indirizzo2 = indirizzo2;
            item.Citta      = citta;
            item.CAP        = cap;
            item.Provincia  = provincia;
            item.Telefono   = telefono;
            item.Fax        = fax;
            item.Note       = note;
            item.Commit();

            categoria.AggregationGalleria.Add(item);
            nazione.AggregationGalleria.Add(item);
            item.Commit();

            _view.DataObject = item;
        }
示例#2
0
 public IEnumerable <Netical.Fotografia.BLL.BOM.GalleriaCategoria> GetCategoriaList()
 {
     return(GalleriaCategoria.RetrieveAll());
 }