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);
     }
 }
Esempio n. 2
0
        private void MaterialsDisplay_SelectedIndexChanged(object sender, EventArgs e)
        {
            string   temp2        = MaterialsDisplay.Text;
            string   resultString = Regex.Match(temp2, @"\d+").Value;
            int      x            = Int32.Parse(resultString);
            Material m            = new Material();

            m.MaterialID = x;
            m            = MaterialMapper.getMaterialById(m);

            txtMaterialName.Text = m.Name;
            txtMaterialDesc.Text = m.Description;
            txtMaterialCost.Text = Convert.ToString(m.Cost);
        }
Esempio n. 3
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);
            }
        }