Esempio n. 1
0
 public ShoesTypes()
 {
     typesCollection = new ObservableCollection <Type>();
     typesCollection = XamlRepository.getShoesTypesData(typesCollection, filePath);
     //typesCollection.Add(new Type(1, "Мокасины"));
     //typesCollection.Add(new Type(2, "Босоножки"));
     //WorkWithXaml.saveData(typesCollection, filePath);
 }
Esempio n. 2
0
 // Add "Shoes type" in the collection.
 public bool AddType(Type typeToList)
 {
     if (typeToList.Id != 0)
     {
         if (!checkType(typeToList))
         {
             TypesCollection.Add(typeToList);
             XamlRepository.saveData(TypesCollection, filePath);
             return(true);
         }
         else
         {
             MessageBox.Show($"Клиент с Id = {typeToList.Id} уже существует.\n Введите другое Id");
             return(false);
         }
     }
     else
     {
         MessageBox.Show($"Поле Id клиента {typeToList.Title} пустое. Введите Id");
         return(false);
     }
 }