Esempio n. 1
0
        public void SetPictureToInspectionAtribute(InspectionAttribute dataContext)
        {
            var buffer = FileHelpers.GetByeArrayFromUserSelectedFile("Image Files |*.jpeg;*.png;*.jpg;*.gif");

            if (buffer == null)
            {
                return;
            }

            dataContext.DiscardImageSource = new DiscardImageSource()
            {
                BinarySource = ImageHelpers.ResizeImage(buffer, 1134, 765, ImageFormat.Jpeg)
            };
        }
Esempio n. 2
0
 public void AddInspectionAttribute(string input)
 {
     if (!input.Equals(""))
     {
         var ia = new InspectionAttribute()
         {
             Description = input
         };
         m_Model.InspectionAttributes.Add(ia);
         InspectionAttribute = string.Empty;
         NotifyOfPropertyChange(() => InspectionAttributes);
         NotifyOfPropertyChange(() => InspectionAttribute);
     }
 }
Esempio n. 3
0
        public void AddProductionItem(object dataContext)
        {
            var productionItemAddViewModel = ((ProductionItemAddViewModel)dataContext);

            if (!productionItemAddViewModel.InspectionAttributes.Any())
            {
                var defaultInspectionAttribute = new InspectionAttribute
                {
                    Number      = "1",
                    Description = TranslationProvider.Translate("Other")
                };

                productionItemAddViewModel.InspectionAttributes.Add(defaultInspectionAttribute);
                m_Repository.InspectionAttributes.Add(defaultInspectionAttribute);
            }

            m_Repository.ProductionItems.Add(productionItemAddViewModel.Model);
            m_Repository.Save();
            CloseEditor();
        }
Esempio n. 4
0
        public void Accept(object dataContext)
        {
            CloseEditor();

            var pievm = ((ProductionItemEditViewModel)dataContext).Model;

            if (!pievm.InspectionAttributes.Any())
            {
                var defaultInspectionAttribute = new InspectionAttribute
                {
                    Number      = "1",
                    Description = TranslationProvider.Translate("Other")
                };

                pievm.InspectionAttributes.Add(defaultInspectionAttribute);
                m_Repository.InspectionAttributes.Add(defaultInspectionAttribute);
            }

            m_Repository.Save();

            NotifyOfPropertyChange(() => FilteredProductionItems);
        }