Example #1
0
        public ICEv3GeneralVM(ICEv3General material, Measurement measure)
        {
            _measure = measure;

            generalMaterials = ICEv3General.ReadICEv3Materials();
            _materialNames   = new List <string>(generalMaterials.Select(a => a.Material).Distinct());

            _genMat   = material;
            _material = material;

            _selectedSubMaterialName = generalMaterials.Where(a => a.GUID == material.Guid).FirstOrDefault();

            if (_selectedSubMaterialName != null)
            {
                _selectedMaterialName = _selectedSubMaterialName.Material;
                _subMaterialNames     = generalMaterials
                                        .Where(a => a.Material == _selectedMaterialName)
                                        .ToList();
            }
            else
            {
                _selectedMaterialName = _materialNames[0];
                _subMaterialNames     = generalMaterials
                                        .Where(a => a.Material == _selectedMaterialName)
                                        .ToList();
            }

            ICEv3Notes = _selectedSubMaterialName.Comments;

            setTransportToSite();
            setTransportToDisposal();
        }
Example #2
0
        void addGeneral()
        {
            var newMat = new ICEv3General();

            _materials.Materials.Add(newMat);
            //_materialVMs.Add(new MaterialVM(newMat, this));
            MaterialNames.Add(newMat.Name);
            _parent.UpdateAll();
        }