static void Main(string[] args) { MyWorkshop MW = new MyWorkshop("Сборочный цех", "Иванов Иван Иванович", 15); for (int i = 0; i < 10; i++) { MW.AddProduct("Изделие№" + (i + 1)); } Console.WriteLine(MW); MW.RemoveProduct(9); Console.WriteLine(MW); MW[7] = "транзистор КТ-315 Г"; Console.WriteLine(MW); Console.WriteLine(MW[4]); MW.RemoveProduct("Изделие№1"); Console.WriteLine(MW); Console.WriteLine(MW.ProductIndex("транзистор КТ-315 Г")); try { MW.RemoveProduct(15); } catch (MyException e) { Console.WriteLine(e.Message); } Console.ReadLine(); }
public AddDialog(Lab_2.MyWorkshop workshop) { InitializeComponent(); WorkshopName = workshop.Name; Chief = workshop.Chief; NumbersOfWorkers = workshop.NumberOfWorkers; Products = workshop.ListOfTheProductRange; }