示例#1
0
        public void Update(int ProductId, int DownloadId)
        {
            ProductDownloadMap item = new ProductDownloadMap();

            item.ProductId = ProductId;

            item.DownloadId = DownloadId;

            item.MarkOld();
            item.Save(UserName);
        }
示例#2
0
        public void Insert(int ProductId, int DownloadId)
        {
            ProductDownloadMap item = new ProductDownloadMap();

            item.ProductId = ProductId;

            item.DownloadId = DownloadId;


            item.Save(UserName);
        }
示例#3
0
        public static void SaveProductMap(int varDownloadId, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM dashCommerce_Store_Product_Download_Map WHERE DownloadId=@DownloadId", Download.Schema.Provider.Name);

            cmdDel.AddParameter("@DownloadId", varDownloadId);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                ProductDownloadMap varProductDownloadMap = new ProductDownloadMap();
                varProductDownloadMap.SetColumnValue("DownloadId", varDownloadId);
                varProductDownloadMap.SetColumnValue("ProductId", item);
                varProductDownloadMap.Save();
            }
        }