예제 #1
0
        private List <Material> CreateSandwichConstructionForRoof(List <string> surface, List <string> materialNames, List <double> materialThickness)
        {
            List <Material>      SandwichConstructionForRoof = new List <Material>();
            IMaterialsRepository materials = new MaterialsRepository();

            for (int i = 0; i < surface.Count; i++)
            {
                if (surface[i] == "Roof")
                {
                    SandwichConstructionForRoof.Add(materials.CreateMaterial(materialNames[i], materialThickness[i]));
                }
            }
            return(SandwichConstructionForRoof);
        }
예제 #2
0
        private void Init()
        {
            IMaterialsRepository materials = new MaterialsRepository();

            cmbFloorsMaterials1.DataSource    = materials.GetMaterials();
            cmbFloorsMaterials1.DisplayMember = nameof(Material.Name);
            cmbFloorsMaterials1.ValueMember   = nameof(Material.Name);


            cmbFloorsMaterials2.BindingContext = new BindingContext();
            cmbFloorsMaterials2.DataSource     = materials.GetMaterials();
            cmbFloorsMaterials2.DisplayMember  = nameof(Material.Name);
            cmbFloorsMaterials2.ValueMember    = nameof(Material.Name);

            cmbRoofMaterials1.BindingContext = new BindingContext();
            cmbRoofMaterials1.DataSource     = materials.GetMaterials();
            cmbRoofMaterials1.DisplayMember  = nameof(Material.Name);
            cmbRoofMaterials1.ValueMember    = nameof(Material.Name);

            cmbWallsMaterials1.BindingContext = new BindingContext();
            cmbWallsMaterials1.DataSource     = materials.GetMaterials();
            cmbWallsMaterials1.DisplayMember  = nameof(Material.Name);
            cmbWallsMaterials1.ValueMember    = nameof(Material.Name);
        }