protected void btnAddAttribute_Click(object sender, EventArgs e) { try { AttributeBL attributeBL = new AttributeBL(); attributeBL.SaveAttributeForCategory(int.Parse(lblCategoryID.Value), int.Parse(cmbAttribute.SelectedValue)); loadAttributes(); } catch (BLException blException) { setStatus(blException.Message, System.Drawing.Color.Red, true); } }
private int addAttribute(int categoryID, string attributeName) { AttributeBL attributeBL = new AttributeBL(); eshopBE.Attribute attribute = new eshopBE.Attribute(); attribute.Name = attributeName; attribute.Filter = false; int attributeID = attributeBL.SaveAttribute(attribute); CategoryBL categoryBL = new CategoryBL(); attributeBL.SaveAttributeForCategory(categoryID, attributeID); return attributeID; }