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

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Exemplo n.º 2
0
        public StoreCollection FetchAll()
        {
            StoreCollection coll = new StoreCollection();
            Query           qry  = new Query(Store.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Exemplo n.º 3
0
        public static AVManager.DAL.StoreCollection GetStoreCollection(int varContactTypeID)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand(
                "SELECT * FROM Store INNER JOIN StoreContact ON " +
                "Store.CustomerID=StoreContact.CustomerID WHERE StoreContact.ContactTypeID=@ContactTypeID", ContactType.Schema.Provider.Name);

            cmd.AddParameter("@ContactTypeID", varContactTypeID, DbType.Int32);
            IDataReader     rdr  = SubSonic.DataService.GetReader(cmd);
            StoreCollection coll = new StoreCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Exemplo n.º 4
0
        public static void SaveStoreMap(int varContactTypeID, StoreCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM StoreContact WHERE ContactTypeID=@ContactTypeID", ContactType.Schema.Provider.Name);

            cmdDel.AddParameter("@ContactTypeID", varContactTypeID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Store item in items)
            {
                StoreContact varStoreContact = new StoreContact();
                varStoreContact.SetColumnValue("ContactTypeID", varContactTypeID);
                varStoreContact.SetColumnValue("CustomerID", item.GetPrimaryKeyValue());
                varStoreContact.Save();
            }
        }
Exemplo n.º 5
0
        public StoreCollection FetchByID(object CustomerID)
        {
            StoreCollection coll = new StoreCollection().Where("CustomerID", CustomerID).Load();

            return(coll);
        }