Exemplo n.º 1
0
        public void Update(int SpecialOfferID, int ProductID, Guid Rowguid, DateTime ModifiedDate)
        {
            SpecialOfferProduct item = new SpecialOfferProduct();

            item.SpecialOfferID = SpecialOfferID;

            item.ProductID = ProductID;

            item.Rowguid = Rowguid;

            item.ModifiedDate = ModifiedDate;

            item.MarkOld();
            item.Save(UserName);
        }
Exemplo n.º 2
0
        public static void SaveProductMap(int varSpecialOfferID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM SpecialOfferProduct WHERE SpecialOfferID=@SpecialOfferID", SpecialOffer.Schema.Provider.Name);

            cmdDel.AddParameter("@SpecialOfferID", varSpecialOfferID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                SpecialOfferProduct varSpecialOfferProduct = new SpecialOfferProduct();
                varSpecialOfferProduct.SetColumnValue("SpecialOfferID", varSpecialOfferID);
                varSpecialOfferProduct.SetColumnValue("ProductID", item);
                varSpecialOfferProduct.Save();
            }
        }