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

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

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Esempio n. 3
0
        public static NorthwindAccess.OrderCollection GetOrderCollection(int varProductID)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand("SELECT * FROM [Orders] INNER JOIN [Order Details] ON [Orders].[OrderID] = [Order Details].[OrderID] WHERE [Order Details].[ProductID] = PARM__ProductID", Product.Schema.Provider.Name);
            cmd.AddParameter("PARM__ProductID", varProductID, DbType.Int32);
            IDataReader     rdr  = SubSonic.DataService.GetReader(cmd);
            OrderCollection coll = new OrderCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Esempio n. 4
0
        public static void SaveOrderMap(int varProductID, OrderCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [Order Details] WHERE [Order Details].[ProductID] = PARM__ProductID", Product.Schema.Provider.Name);

            cmdDel.AddParameter("PARM__ProductID", varProductID, DbType.Int32);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Order item in items)
            {
                OrderDetail varOrderDetail = new OrderDetail();
                varOrderDetail.SetColumnValue("ProductID", varProductID);
                varOrderDetail.SetColumnValue("OrderID", item.GetPrimaryKeyValue());
                varOrderDetail.Save();
            }
        }
Esempio n. 5
0
        public OrderCollection FetchByID(object OrderID)
        {
            OrderCollection coll = new OrderCollection().Where("OrderID", OrderID).Load();

            return(coll);
        }