public CultureCollection FetchByQuery(Query qry) { CultureCollection coll = new CultureCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public CultureCollection FetchAll() { CultureCollection coll = new CultureCollection(); Query qry = new Query(Culture.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public static AVManager.DAL.CultureCollection GetCultureCollection(int varProductDescriptionID) { SubSonic.QueryCommand cmd = new SubSonic.QueryCommand( "SELECT * FROM Culture INNER JOIN ProductModelProductDescriptionCulture ON " + "Culture.CultureID=ProductModelProductDescriptionCulture.CultureID WHERE ProductModelProductDescriptionCulture.ProductDescriptionID=@ProductDescriptionID", ProductDescription.Schema.Provider.Name); cmd.AddParameter("@ProductDescriptionID", varProductDescriptionID, DbType.Int32); IDataReader rdr = SubSonic.DataService.GetReader(cmd); CultureCollection coll = new CultureCollection(); coll.LoadAndCloseReader(rdr); return(coll); }
public static void SaveCultureMap(int varProductDescriptionID, CultureCollection items) { QueryCommandCollection coll = new SubSonic.QueryCommandCollection(); //delete out the existing QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductModelProductDescriptionCulture WHERE ProductDescriptionID=@ProductDescriptionID", ProductDescription.Schema.Provider.Name); cmdDel.AddParameter("@ProductDescriptionID", varProductDescriptionID); coll.Add(cmdDel); DataService.ExecuteTransaction(coll); foreach (Culture item in items) { ProductModelProductDescriptionCulture varProductModelProductDescriptionCulture = new ProductModelProductDescriptionCulture(); varProductModelProductDescriptionCulture.SetColumnValue("ProductDescriptionID", varProductDescriptionID); varProductModelProductDescriptionCulture.SetColumnValue("CultureID", item.GetPrimaryKeyValue()); varProductModelProductDescriptionCulture.Save(); } }
public CultureCollection FetchByID(object CultureID) { CultureCollection coll = new CultureCollection().Where("CultureID", CultureID).Load(); return(coll); }