예제 #1
0
        public CultureCollection FetchByQuery(Query qry)
        {
            CultureCollection coll = new CultureCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
예제 #2
0
        public CultureCollection FetchAll()
        {
            CultureCollection coll = new CultureCollection();
            Query             qry  = new Query(Culture.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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();
            }
        }
예제 #5
0
        public CultureCollection FetchByID(object CultureID)
        {
            CultureCollection coll = new CultureCollection().Where("CultureID", CultureID).Load();

            return(coll);
        }