}// Lägger till en rad i listan genom CreateElectronics metoden Clothes CreateClothes() { Clothes newClothes = new Clothes(); newClothes.ProductName = InputController.NameController(); newClothes.Price = InputController.PriceController(); newClothes.ProductMake = InputController.MakeController(); newClothes.ProductionDate = InputController.YearController(); newClothes.ProductionLand = InputController.LandController(); return(newClothes); } // metod för att ta emot inputs för list raden och returnera det
} // metod för att ta emot inputs för list raden och returnera det public void PrintClothesList() { int index = 0; Console.WriteLine("************************"); Console.WriteLine("******* Clothes ********"); Console.WriteLine("************************\n"); var newClothes = Clothes.GetClothes(); foreach (var item in newClothes) { index++; Console.WriteLine(index + ". " + item.GetInformation()); } } //Visar listans innehåll
} //Remove sen sparar den till filen public static void AddClothes(Clothes newClothes) { ListManager.Clothes.Add(newClothes); File.WriteAllText(listPath, JsonConvert.SerializeObject(ListManager.Clothes)); } //Laddar upp listan till filen