I'm very new to programming, and right now I am learning how to code. Right now I am trying to create some database program, which has some kind of menu, ability to write in data, and read the data which has been already inputed. Somehow I managed to create Menu method, but I don't know, how to open in directly from method Main. Could you please help me, what to do ? I've been looking for simmilar thread, but I can't find anything helpful for me. Again, I am learning from absolute zero, so I hope you won't be very salty about it.
PS: Places where are "Hello World" section I haven't written yet. I got it there only for filing space purposes.
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApp1
{
public class Program
{
private void Main(string[] args)
{
}
private static bool Menu()
{
Console.Clear();
Console.WriteLine("Vyberte moznost:");
Console.WriteLine("1) Zapis nóveho studenta [N]");
Console.WriteLine("2) Seznam zapsanych studentu [S]");
Console.WriteLine("3) Konec [K]");
Console.Write("\r\nSelect an option: ");
var input = Console.ReadKey();
switch (input.Key)
{
case ConsoleKey.N:
NewStudent();
return true;
case ConsoleKey.S:
StudentSeznam();
return true;
case ConsoleKey.K:
return false;
default:
return true;
}
}
public static void NewStudent()
{
Console.WriteLine("Hello World.");
}
private static void StudentSeznam()
{
Console.WriteLine("Hello World.");
}
}
public class StudentList
{
Console.WriteLine("Hello World.");
}
}