public static void TestUcommerceDatabaseConnection() { var uCommerceConnectionString = ConfigurationManager.ConnectionStrings["UCommerceConnectionString"].ConnectionString; using (var connection = SqlSessionFactory.Create(uCommerceConnectionString)) { connection.ExecuteScalar <int>("select count(*) from ucommerce_productcatalog"); } }
public static void TestSitefinityDatabaseConnection() { var sitefinityConnectionString = ConfigurationManager.ConnectionStrings["SitefinityConnectionString"].ConnectionString; using (var connection = SqlSessionFactory.Create(sitefinityConnectionString)) { connection.ExecuteScalar <int>("select count(*) from sf_sites"); } }
public static int GetProductCount() { var sitefinityConnectionString = ConfigurationManager.ConnectionStrings["SitefinityConnectionString"].ConnectionString; using (var connection = SqlSessionFactory.Create(sitefinityConnectionString)) { return(connection.ExecuteScalar <int>("select count(*) from sf_ec_product where status = 0")); } }
public static IEnumerable <Guid> GetProductCategoryAssociations(string productId) { var sitefinityConnectionString = ConfigurationManager.ConnectionStrings["SitefinityConnectionString"].ConnectionString; using (var connection = SqlSessionFactory.Create(sitefinityConnectionString)) { return(connection.Query <Guid>( "select taxa.id from sf_ec_product prod " + "join sf_ec_product_department dept on prod.id = dept.id " + "join sf_taxa taxa on dept.val = taxa.id " + $"where prod.id = '{productId}'")); } }