public int AddSubTheme(SubTheme subtheme)
 {
     using (ThemesDAO.Connection = ConnectionSettings.CreateDBConnection())
     {
         return ThemesDAO.AddSubTheme(subtheme);
     }
 }
Exemple #2
0
 public int AddSubTheme(SubTheme subtheme)
 {
     return DbTemplateHelper<int>.GetValueByProcedure(
         Connection,
         "config.insertsubtheme",
         new DbParameterHelper[]
         {
             new DbParameterHelper(DbType.String,    "p_name",           subtheme.Name),
             new DbParameterHelper(DbType.String,    "p_nameAbbr",       subtheme.NameAbbr),
             new DbParameterHelper(DbType.Int32,     "p_themeid",        subtheme.ThemeID),
             new DbParameterHelper(DbType.Int32,     "p_providerid",     subtheme.ProviderID)
         });
 }
 public void GetProviderSubThemesTest()
 {
     ThemesDAO target = new ThemesDAO(connnetion);
     int providerId = 1;
     int themeId = 1;
     SubTheme expected = new SubTheme
     {
         ID = 1,
         Name = "Ordenamento do território",
         NameAbbr = "Ordenamento do território",
         ProviderID = 1,
         ThemeID = 1
     };
     IEnumerable<SubTheme> actual;
     actual = target.GetProviderSubThemes(providerId, themeId);
     Assert.AreEqual(1, actual.Count());
     Assert.AreEqual(expected, actual.ElementAt(0));
 }