Ejemplo n.º 1
0
        public AddressTypeCollection FetchByQuery(Query qry)
        {
            AddressTypeCollection coll = new AddressTypeCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Ejemplo n.º 2
0
        public AddressTypeCollection FetchAll()
        {
            AddressTypeCollection coll = new AddressTypeCollection();
            Query qry = new Query(AddressType.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Ejemplo n.º 3
0
        public static AVManager.DAL.AddressTypeCollection GetAddressTypeCollection(int varVendorID)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand(
                "SELECT * FROM AddressType INNER JOIN VendorAddress ON " +
                "AddressType.AddressTypeID=VendorAddress.AddressTypeID WHERE VendorAddress.VendorID=@VendorID", Vendor.Schema.Provider.Name);

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

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Ejemplo n.º 4
0
        public static void SaveAddressTypeMap(int varVendorID, AddressTypeCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM VendorAddress WHERE VendorID=@VendorID", Vendor.Schema.Provider.Name);

            cmdDel.AddParameter("@VendorID", varVendorID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (AddressType item in items)
            {
                VendorAddress varVendorAddress = new VendorAddress();
                varVendorAddress.SetColumnValue("VendorID", varVendorID);
                varVendorAddress.SetColumnValue("AddressTypeID", item.GetPrimaryKeyValue());
                varVendorAddress.Save();
            }
        }
Ejemplo n.º 5
0
        public AddressTypeCollection FetchByID(object AddressTypeID)
        {
            AddressTypeCollection coll = new AddressTypeCollection().Where("AddressTypeID", AddressTypeID).Load();

            return(coll);
        }