protected void btnAddValue_Click(object sender, EventArgs e) { AttributeValue attributeValue = new AttributeValue(); attributeValue.Value = txtValue.Text; attributeValue.AttributeID = int.Parse(lblAttributeID.Value); AttributeBL attributeBL = new AttributeBL(); attributeBL.SaveAttributeValue(attributeValue, false); loadValues(); }
protected void btnAddAttributeValue_Click(object sender, EventArgs e) { switch (lblType.Value) { case "attribute": { AttributeBL attributeBL = new AttributeBL(); attributeBL.SaveAttributeValue(new AttributeValue(-1, txtAttributeValue.Text, int.Parse(lblAttributeID.Value), 0, string.Empty, 0), false); foreach (object control in pnlAttributes.Controls) { if (control is customControls.AttributeControl) { if (((customControls.AttributeControl)control).ID == lblAttributeName.Value) { ((customControls.AttributeControl)control).setValues(); } } } break; } case "supplier": { SupplierBL supplierBL = new SupplierBL(); supplierBL.SaveSupplier(new Supplier(-1, txtAttributeValue.Text)); loadSupplier(); break; } case "brand": { BrandBL brandBL = new BrandBL(); brandBL.SaveBrand(new Brand(-1, txtAttributeValue.Text)); loadBrands(); break; } } txtAttributeValue.Text = string.Empty; }