public void menu() { Console.WriteLine("1.Auto fill"); Console.WriteLine("2.Manual fill"); Console.WriteLine("3.Import from file"); Console.WriteLine("4.Exit"); CardFailes[] cardFaileses = null; CardFailes c = new CardFailes(); int a = c.writeInt("Choose number "); switch (a) { case 1: int b = c.writeInt("Enter count: "); cardFaileses = c.autoInit(b); break; case 2: int bb = c.writeInt("Enter count: "); cardFaileses = c.manualInit(bb); break; case 3: string bbb = c.writeString("Entre path: "); cardFaileses = c.fileInit(bbb); if (cardFaileses == null) { Console.WriteLine("Error!"); menu(); return; } break; case 4: Environment.Exit(1); break; default: Console.WriteLine("Error!"); menu(); return; } nextmenu(cardFaileses); }
public void nextmenu(CardFailes[] a) { Console.WriteLine("1.Swap apartment"); Console.WriteLine("2.OutInf"); Console.WriteLine("3.Export to file"); Console.WriteLine("4.Exit"); CardFailes[] cardFaileses = a; CardFailes c = new CardFailes(); int sk = c.writeInt("Choose number "); switch (sk) { case 1: Console.WriteLine("Describe your apartment"); CardFailes temp = c.manualInit(1)[0]; cardFaileses = c.swapApartment(cardFaileses, temp); break; case 2: c.outInf(cardFaileses); break; case 3: c.writeCardsToFile(cardFaileses); break; case 4: Environment.Exit(1); break; default: Console.WriteLine("Error!"); nextmenu(a); return; } nextmenu(cardFaileses); }