Example #1
0
 public IList <T> GetAll(decimal?idPadre)
 {
     Com.Delta.Data.IDaoBaseSession <ISessionModel> provider = getDaoContext();
     if (idPadre.HasValue)
     {
         using (ITitoloDao dao = provider.DaoImpl.TitoloDao)
         {
             return(dao.GetSottotitoliByIdPadre(idPadre.Value) as IList <T>);
         }
     }
     else
     {
         if (typeof(T) == typeof(Titolo))
         {
             using (ITitoloDao dao = provider.DaoImpl.TitoloDao)
             {
                 return(dao.GetAll() as IList <T>);
             }
         }
         else
         {
             using (ISottoTitoloDao dao = provider.DaoImpl.SottoTitoloDao)
             {
                 return(dao.GetAll() as IList <T>);
             }
         }
     }
 }
Example #2
0
 public IList <T> FindByTitolo(decimal tkey)
 {
     Com.Delta.Data.IDaoBaseSession <ISessionModel> provider = getDaoContext();
     using (ISottoTitoloDao dao = provider.DaoImpl.SottoTitoloDao)
     {
         return(dao.FindByTitolo(tkey) as IList <T>);
     }
 }
Example #3
0
 public T LoadTitoloById(decimal id)
 {
     Com.Delta.Data.IDaoBaseSession <ISessionModel> provider = getDaoContext();
     if (typeof(T) == typeof(Titolo))
     {
         using (ITitoloDao dao = provider.DaoImpl.TitoloDao)
         {
             return(dao.GetById(id) as T);
         }
     }
     else
     {
         using (ISottoTitoloDao dao = provider.DaoImpl.SottoTitoloDao)
         {
             return(dao.GetById(id) as T);
         }
     }
 }