Exemplo n.º 1
0
        public void Save(FrameModel frame)
        {
            Serializer.XMLSerializator serialization =
                new Serializer.XMLSerializator(typeof(FrameModel));

            serialization.Serialization(frame, pathXML);
        }
Exemplo n.º 2
0
        public void FinalAmount(MaterialModel material, FrameModel frame, MainViewModel mv)
        {
            mv.CheckLabel = "";

            int finalAmount = material.QuanPerUnit * frame.Width * frame.Length * frame.Quantity;

            if (material.QuanInStock >= finalAmount)
            {
                mv.CheckLabel += enoughString + material.Name + ".\n" + youNeedString +
                                 finalAmount + youHaveString + material.QuanInStock + ".\n\n";
            }

            else if (material.QuanInStock < finalAmount)
            {
                mv.CheckLabel += notEnoughString + material.Name + ".\n" + youNeedString +
                                 finalAmount + youHaveString + material.QuanInStock + ".\n\n";
            }
        }
Exemplo n.º 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();
        }
Exemplo n.º 4
0
 public List <MaterialModel> GetMaterials(FrameModel frame)
 {
     return(frame.Materials);
 }