Esempio n. 1
0
        public ProductModelCollection FetchByQuery(Query qry)
        {
            ProductModelCollection coll = new ProductModelCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Esempio n. 2
0
        public ProductModelCollection FetchAll()
        {
            ProductModelCollection coll = new ProductModelCollection();
            Query qry = new Query(ProductModel.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Esempio n. 3
0
        public static AVManager.DAL.ProductModelCollection GetProductModelCollection(int varIllustrationID)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand(
                "SELECT * FROM ProductModel INNER JOIN ProductModelIllustration ON " +
                "ProductModel.ProductModelID=ProductModelIllustration.ProductModelID WHERE ProductModelIllustration.IllustrationID=@IllustrationID", Illustration.Schema.Provider.Name);

            cmd.AddParameter("@IllustrationID", varIllustrationID, DbType.Int32);
            IDataReader            rdr  = SubSonic.DataService.GetReader(cmd);
            ProductModelCollection coll = new ProductModelCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Esempio n. 4
0
        public static AVManager.DAL.ProductModelCollection GetProductModelCollection(string varCultureID)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand(
                "SELECT * FROM ProductModel INNER JOIN ProductModelProductDescriptionCulture ON " +
                "ProductModel.ProductModelID=ProductModelProductDescriptionCulture.ProductModelID WHERE ProductModelProductDescriptionCulture.CultureID=@CultureID", Culture.Schema.Provider.Name);

            cmd.AddParameter("@CultureID", varCultureID, DbType.String);
            IDataReader            rdr  = SubSonic.DataService.GetReader(cmd);
            ProductModelCollection coll = new ProductModelCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Esempio n. 5
0
        public static void SaveProductModelMap(int varIllustrationID, ProductModelCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductModelIllustration WHERE IllustrationID=@IllustrationID", Illustration.Schema.Provider.Name);

            cmdDel.AddParameter("@IllustrationID", varIllustrationID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (ProductModel item in items)
            {
                ProductModelIllustration varProductModelIllustration = new ProductModelIllustration();
                varProductModelIllustration.SetColumnValue("IllustrationID", varIllustrationID);
                varProductModelIllustration.SetColumnValue("ProductModelID", item.GetPrimaryKeyValue());
                varProductModelIllustration.Save();
            }
        }
Esempio n. 6
0
        public static void SaveProductModelMap(string varCultureID, ProductModelCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductModelProductDescriptionCulture WHERE CultureID=@CultureID", Culture.Schema.Provider.Name);

            cmdDel.AddParameter("@CultureID", varCultureID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (ProductModel item in items)
            {
                ProductModelProductDescriptionCulture varProductModelProductDescriptionCulture = new ProductModelProductDescriptionCulture();
                varProductModelProductDescriptionCulture.SetColumnValue("CultureID", varCultureID);
                varProductModelProductDescriptionCulture.SetColumnValue("ProductModelID", item.GetPrimaryKeyValue());
                varProductModelProductDescriptionCulture.Save();
            }
        }
Esempio n. 7
0
        public ProductModelCollection FetchByID(object ProductModelID)
        {
            ProductModelCollection coll = new ProductModelCollection().Where("ProductModelID", ProductModelID).Load();

            return(coll);
        }