public List <string> NamesOfMaterials(FrameShopModel frameShop) { var NamesOfMaterials = new List <string>(); foreach (MaterialModel material in frameShop.Materials) { NamesOfMaterials.Add(material.Name); } return(NamesOfMaterials); }
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(); }
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(); }
public List <MaterialModel> GetMaterials(FrameShopModel frameShop) { return(frameShop.Materials); }