public UnitMeasureCollection FetchByQuery(Query qry) { UnitMeasureCollection coll = new UnitMeasureCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public UnitMeasureCollection FetchAll() { UnitMeasureCollection coll = new UnitMeasureCollection(); Query qry = new Query(UnitMeasure.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
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); }
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(); } }
public UnitMeasureCollection FetchByID(object UnitMeasureCode) { UnitMeasureCollection coll = new UnitMeasureCollection().Where("UnitMeasureCode", UnitMeasureCode).Load(); return(coll); }