Exemple #1
0
        public IllustrationCollection FetchByQuery(Query qry)
        {
            IllustrationCollection coll = new IllustrationCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Exemple #2
0
        public IllustrationCollection FetchAll()
        {
            IllustrationCollection coll = new IllustrationCollection();
            Query qry = new Query(Illustration.Schema);

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

            cmd.AddParameter("@ProductModelID", varProductModelID, DbType.Int32);
            IDataReader            rdr  = SubSonic.DataService.GetReader(cmd);
            IllustrationCollection coll = new IllustrationCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Exemple #4
0
        public static void SaveIllustrationMap(int varProductModelID, IllustrationCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductModelIllustration WHERE ProductModelID=@ProductModelID", ProductModel.Schema.Provider.Name);

            cmdDel.AddParameter("@ProductModelID", varProductModelID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Illustration item in items)
            {
                ProductModelIllustration varProductModelIllustration = new ProductModelIllustration();
                varProductModelIllustration.SetColumnValue("ProductModelID", varProductModelID);
                varProductModelIllustration.SetColumnValue("IllustrationID", item.GetPrimaryKeyValue());
                varProductModelIllustration.Save();
            }
        }
Exemple #5
0
        public IllustrationCollection FetchByID(object IllustrationID)
        {
            IllustrationCollection coll = new IllustrationCollection().Where("IllustrationID", IllustrationID).Load();

            return(coll);
        }