public void Update(int AttributeId, int ProductId, int SortOrder, bool IsRequired)
        {
            ProductAttributeMap item = new ProductAttributeMap();

            item.AttributeId = AttributeId;

            item.ProductId = ProductId;

            item.SortOrder = SortOrder;

            item.IsRequired = IsRequired;

            item.MarkOld();
            item.Save(UserName);
        }
Exemple #2
0
        public static void SaveProductMap(int varAttributeId, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM dashCommerce_Store_Product_Attribute_Map WHERE AttributeId=@AttributeId", Attribute.Schema.Provider.Name);

            cmdDel.AddParameter("@AttributeId", varAttributeId);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                ProductAttributeMap varProductAttributeMap = new ProductAttributeMap();
                varProductAttributeMap.SetColumnValue("AttributeId", varAttributeId);
                varProductAttributeMap.SetColumnValue("ProductId", item);
                varProductAttributeMap.Save();
            }
        }
Exemple #3
0
        public static void SaveAttributeMap(int varProductId, System.Web.UI.WebControls.ListItemCollection itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM dashCommerce_Store_Product_Attribute_Map WHERE ProductId=@ProductId", Product.Schema.Provider.Name);

            cmdDel.AddParameter("@ProductId", varProductId);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (System.Web.UI.WebControls.ListItem l in itemList)
            {
                if (l.Selected)
                {
                    ProductAttributeMap varProductAttributeMap = new ProductAttributeMap();
                    varProductAttributeMap.SetColumnValue("ProductId", varProductId);
                    varProductAttributeMap.SetColumnValue("AttributeId", l.Value);
                    varProductAttributeMap.Save();
                }
            }
        }
 public bool Destroy(object AttributeId)
 {
     return(ProductAttributeMap.Destroy(AttributeId) == 1);
 }
 public bool Delete(object AttributeId)
 {
     return(ProductAttributeMap.Delete(AttributeId) == 1);
 }