private void fillList()
 {
     foreach (BillOfMaterial m in BillOfMaterial.testing(product))
     {
         //Material temp = MaterialMapper.getMaterialById(m);
         Material derp = new Material(m.MaterialId);
         derp = MaterialMapper.getMaterialById(derp);
         string quant = m.Quantity.ToString();
         addedListBox.Items.Add("ID - " + derp.MaterialID + " - " + derp.Name + " Quantity " + quant);
     }
 }
Exemplo n.º 2
0
        private void ProductDisplay_SelectedIndexChanged(object sender, EventArgs e)
        {
            lstMaterialsRequired.Items.Clear();
            string  temp2        = ProductDisplay.Text;
            string  resultString = Regex.Match(temp2, @"\d+").Value;
            int     x            = Int32.Parse(resultString);
            Product p            = new Product(x);

            p = ProductMapper.getProductById(p);
            //p = ProductMapper.getMaterialsRequired(p);

            txtProductName.Text = p.Name;
            txtProductDesc.Text = p.Description;
            txtProductCost.Text = Convert.ToString(p.RetailPrice);

            foreach (BillOfMaterial m in BillOfMaterial.testing(p))
            {
                Material derp = new Material(m.MaterialId);
                derp = MaterialMapper.getMaterialById(derp);
                string quant = m.Quantity.ToString();
                lstMaterialsRequired.Items.Add(derp.Name + " Quantity " + quant);
            }
        }