Example #1
0
        public int getAttributeValueID(int attributeID, string value)
        {
            AttributeBL attributeBL = new AttributeBL();
            List<AttributeValue> attributeValues = attributeBL.GetAttributeValues(attributeID);
            int attributeValueID = 0;
            bool exists = false;

            if (attributeValues != null)
            {
                for (int i = 0; i < attributeValues.Count; i++)
                    if (attributeValues[i].Value == value)
                    {
                        attributeValueID = attributeValues[i].AttributeValueID;
                        exists = true;
                        break;
                    }
            }

            if (!exists)
            {
                AttributeValue attributeValue = new AttributeValue(-1, value, attributeID, 0, string.Empty, 0);
                attributeValueID = attributeBL.SaveAttributeValue(attributeValue, false);
            }
            return attributeValueID;
        }
Example #2
0
        public void setValues()
        {
            AttributeBL attributeBL = new AttributeBL();

            cmbAttribute.DataSource = attributeBL.GetAttributeValues(_attributeID);
            cmbAttribute.DataValueField = "attributeValueID";
            cmbAttribute.DataTextField = "value";
            cmbAttribute.DataBind();
            cmbAttribute.SelectedValue = cmbAttribute.Items.FindByText("NP").Value;
            lblAttributeID.Value = _attributeID.ToString();
        }
Example #3
0
 private void loadValues()
 {
     AttributeBL attributeBL = new AttributeBL();
     dgvAttributeValues.DataSource = attributeBL.GetAttributeValues(int.Parse(lblAttributeID.Value));
     dgvAttributeValues.DataBind();
 }