public bool DeleteProductAttribute(int storeID, ProductAttributeOptionValue paov) { try { this._sessionManager.OpenSession().Delete(paov); this._sessionManager.OpenSession().Flush(); } catch (Exception e) { LogManager.GetLogger(GetType()).Error(e); return false; } return true; }
public List<ProductAttributeOptionValue> GetUpdatedAttributes(long productID) { if (attributes == null) { return new List<ProductAttributeOptionValue>(); } List<ProductAttributeOptionValue> aList = new List<ProductAttributeOptionValue>(); foreach (IActiveProductAttribute a in attributes) { if (Request.Form["p$attributeEditor$Attribute" + a.Name.Replace(" ", "")] == "on") { //nasty hack FIXME foreach (IAttributeOption ao in a.AttributeOptionList) { if (Request.Form["p$attributeEditor$Option" + ao.ShortCode] == "on") { ProductAttributeOptionValue attribute = new ProductAttributeOptionValue(); attribute.OptionPrice = Convert.ToDecimal(Request.Form["p$attributeEditor$txt" + ao.ShortCode]); attribute.OptionValueCode = ao.ShortCode; attribute.ProductID = productID; attribute.OptionValueid = Convert.ToInt64(ao.ShortCode); aList.Add(attribute); attribute = null; } } } } return aList; }