public int ReadInput(int choice) { telephone t = new telephone(); int sel = choice; while (sel <= 6) { Console.Clear(); Console.WriteLine("1 : enter information"); Console.WriteLine("2 : display information"); Console.WriteLine("3 : search information"); Console.WriteLine("4 : edit information"); Console.WriteLine("5 : delete information"); Console.WriteLine("6 : exit"); Console.Write("\nenter your choose : "); sel = Convert.ToInt32(Console.ReadLine()); if (sel > 6 || sel <= 0) { throw new ArgumentException(); } switch (sel) { case 1: t.enter_info(); break; case 2: t.show_info(); break; case 3: t.search_ifo(); break; case 4: t.edit_info(); break; case 5: t.delet_ifo(); break; } } return(0); }
public void enter_info() { Console.Clear(); telephone t = new telephone(); Console.Write("enter name : "); t.name = Console.ReadLine(); Console.Write("enter tel : "); t.tel = Console.ReadLine(); Console.Write("enter Address : "); t.address = Console.ReadLine(); Console.Write("enter Occupation : "); t.occupation = Console.ReadLine(); Console.Write("enter Connection Date : "); t.ConnDate = Console.ReadLine(); tel_book_arr.Add(t); AppendText(tel_book_arr); }