Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication11
- {
- class Store
- {
- public static int count = 0;
- public string country;
- public ushort id;
- public ushort price;
- public string name;
- public string userName;
- public ushort userMoney;
- public Store(string userName, ushort userMoney)
- {
- this.userName = userName;
- this.userMoney = userMoney;
- }
- public Store(string country, ushort id, ushort price, string name)
- {
- this.country = country;
- this.id = id;
- this.price = price;
- this.name = name;
- }
- public void idOfshoes()
- {
- Console.WriteLine("Id: " + id);
- }
- public void ShowUserInfo()
- {
- Console.WriteLine("Profile: " + userName + "\nTotal money: " + userMoney + '$');
- }
- public void ShowInfoAboutModel()
- {
- Console.WriteLine("County: " + country + "\nId: " + id + "\nPrice: " + price + '$' + "\nName: " + name + "\n");
- }
- }
- class Goods
- {
- static void Main(string[] args)
- {
- List<Store> AllUsers = new List<Store>();
- //user
- AllUsers.Add(new Store("Alex", 500));
- foreach (Store user in AllUsers)
- {
- user.ShowUserInfo();
- }
- List<Store> Itali = new List<Store>();
- //shoes
- Itali.Add(new Store("Itali", 10, 400, "Angel"));
- Itali.Add(new Store("Itali", 11, 450, "Banini"));
- Console.WriteLine();
- List<Store> France = new List<Store>();
- France.Add(new Store("France", 20, 445, "Merci"));
- France.Add(new Store("France", 21, 400, "Flamme"));
- Console.WriteLine("Choose a shoe model...\n\nFor Italian - press 1 \nFor French - press 2");
- there:
- sbyte choice = Convert.ToSByte(Console.ReadLine());
- while (true)
- {
- if (choice == 1)
- {
- foreach (Store italian in Itali)
- {
- italian.ShowInfoAboutModel();
- }
- Console.WriteLine("for buy select... y\n");
- char select = Convert.ToChar(Console.ReadLine());
- if (select == 'y')
- {
- Console.WriteLine("Select id of shoe...");
- foreach (Store numberOfId in Itali)
- {
- Console.WriteLine(numberOfId.id);
- //sbyte shoeSelect = Convert.ToSByte(Console.ReadLine());
- // Console.ReadLine();
- }
- }
- break;
- }
- else if (choice == 2)
- {
- foreach (Store french in France)
- {
- french.ShowInfoAboutModel();
- }
- }
- if (choice != 1 & choice != 2)
- {
- Console.WriteLine("Select 1 or 2");
- Console.ReadKey();
- goto there;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement