コード例 #1
0
        public UnitMeasureCollection FetchByQuery(Query qry)
        {
            UnitMeasureCollection coll = new UnitMeasureCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
コード例 #2
0
        public UnitMeasureCollection FetchAll()
        {
            UnitMeasureCollection coll = new UnitMeasureCollection();
            Query qry = new Query(UnitMeasure.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
コード例 #3
0
        public static AVManager.DAL.UnitMeasureCollection GetUnitMeasureCollection(int varVendorID)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand(
                "SELECT * FROM UnitMeasure INNER JOIN ProductVendor ON " +
                "UnitMeasure.UnitMeasureCode=ProductVendor.UnitMeasureCode WHERE ProductVendor.VendorID=@VendorID", Vendor.Schema.Provider.Name);

            cmd.AddParameter("@VendorID", varVendorID, DbType.Int32);
            IDataReader           rdr  = SubSonic.DataService.GetReader(cmd);
            UnitMeasureCollection coll = new UnitMeasureCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
コード例 #4
0
        public static void SaveUnitMeasureMap(int varVendorID, UnitMeasureCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductVendor WHERE VendorID=@VendorID", Vendor.Schema.Provider.Name);

            cmdDel.AddParameter("@VendorID", varVendorID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (UnitMeasure item in items)
            {
                ProductVendor varProductVendor = new ProductVendor();
                varProductVendor.SetColumnValue("VendorID", varVendorID);
                varProductVendor.SetColumnValue("UnitMeasureCode", item.GetPrimaryKeyValue());
                varProductVendor.Save();
            }
        }
コード例 #5
0
        public UnitMeasureCollection FetchByID(object UnitMeasureCode)
        {
            UnitMeasureCollection coll = new UnitMeasureCollection().Where("UnitMeasureCode", UnitMeasureCode).Load();

            return(coll);
        }