public int AddTheme(Theme theme) { using (ThemesDAO.Connection = ConnectionSettings.CreateDBConnection()) { return ThemesDAO.AddTheme(theme); } }
public int AddTheme(Theme theme) { return DbTemplateHelper<int>.GetValueByProcedure( Connection, "config.inserttheme", new DbParameterHelper[] { new DbParameterHelper(DbType.String, "p_name", theme.Name), new DbParameterHelper(DbType.String, "p_nameAbbr", theme.NameAbbr), new DbParameterHelper(DbType.Int32, "p_providerid", theme.ProviderID) }); }
public void GetProviderThemesTest() { ThemesDAO target = new ThemesDAO(connnetion); int providerId = 1; Theme expected = new Theme { ID = 1, Name = "Território", NameAbbr = "Território", ProviderID = 1 }; IEnumerable<Theme> actual = target.GetProviderThemes(providerId); Assert.AreEqual(1, actual.Count()); Assert.AreEqual(expected, actual.ElementAt(0)); }