예제 #1
0
        public List <string> NamesOfMaterials(FrameShopModel frameShop)
        {
            var NamesOfMaterials = new List <string>();

            foreach (MaterialModel material in frameShop.Materials)
            {
                NamesOfMaterials.Add(material.Name);
            }
            return(NamesOfMaterials);
        }
예제 #2
0
        public void FrameShopFill(MaterialModel material, FrameShopModel frameShop)
        {
            if (material != null)
            {
                frameShop.Materials.Add(material);
            }
            var newFrameShop = _mapper.Map <FrameShop>(frameShop);

            _unitOfWork.FrameShopRepository.Add(newFrameShop);
            _unitOfWork.Save();
        }
예제 #3
0
        public void CreateFrame(FrameShopModel frameShop, MainViewModel mv, FrameModel frame)
        {
            foreach (MaterialModel material in frameShop.Materials)
            {
                foreach (MainViewModel.CheckedListItem <string> item in mv.CustomCheckBox)
                {
                    if (material.Name == item.Item & item.IsChecked == true)
                    {
                        frame.Materials.Add(material);
                        FinalAmount(material, frame, mv);
                    }
                }
            }
            var newFrame = _mapper.Map <Frame>(frame);

            _unitOfWork.FrameRepository.Add(newFrame);
            _unitOfWork.Save();
        }
예제 #4
0
 public List <MaterialModel> GetMaterials(FrameShopModel frameShop)
 {
     return(frameShop.Materials);
 }