I have a variable called arrayForStudents. it has 5 columns you can see how should it be applied from line 51 to line 63 code block but I am getting trouble how should I add the value as simple as interting values in the database. I need help

using System;

//Python Based Conversion to Csharp of Record Entry and Monitoring
namespace Oween25
{
    class Program
    {
        static void Main(string[] args)
        {
            string[,,,,] arrayForStudents;
        //label the beggning of the line for repeatitions
        Start:
            Console.Clear();
            Console.WriteLine("--------------------------------------\n" +
                "Welcome to the Day Care System" +
                "\n--------------------------------------\n");
            string endOrRestart;
            bool incorrectOption1 = true;
            while (incorrectOption1)
            {
                Console.WriteLine("Master record of Students and Employees\nChoose from the selection below.");
                Console.WriteLine("1. Students' Infomration \n2. Employees' Information\nInput: ");
                //forcing to read char from user input
                string mainSelect = Convert.ToString(Console.ReadLine());
                //
                switch (mainSelect)
                {
                    case "1":
                        //for students
                        bool incorrectOption2 = true;
                        while (incorrectOption2)
                        {
                        //labeling for incorrect input on option for enrollment    
                        IncorrectInput1:
                            Console.WriteLine("1. Enroll Students\n2. View All Enrolled Students\n3. Update Student Information\n4. Delete Student By Student ID" +
                        "\n5. Number of Students Enrolled\n6. Clear Database\n7. Go Back to Main Menu:");
                            incorrectOption1 = false;
                            string selectStudentOption1 = Convert.ToString(Console.ReadLine());
                            switch (selectStudentOption1)
                            {
                                case "1": //enroll students
                                    incorrectOption2 = false;
                                    Console.WriteLine("Emter Number of Enrollees"); //for loop needed
                                    string numOfEnrollees = Console.ReadLine();
                                    int num = 1;
                                    //humman error catch
                                    if (int.TryParse(numOfEnrollees, out num))
                                    {
                                        //looping starts  here
                                        for (int nOE = 0; nOE < Convert.ToInt32(numOfEnrollees); nOE++)
                                        {
                                            Console.WriteLine("Emter Name of Enrollee(s):");
                                            string nameOfEnrollees = Convert.ToString(Console.ReadLine());
                                            Console.WriteLine("Enter Birth Date:");
                                            string BirthOfEnrollees = Convert.ToString(Console.ReadLine());
                                            Console.WriteLine("Enter Gender");
                                            string GenderOfEnrollees = Convert.ToString(Console.ReadLine());
                                            Console.WriteLine("Enter Address");
                                            string AddressOfEnrollees = Convert.ToString(Console.ReadLine());
                                            Console.WriteLine("Enter Student ID:");
                                            string IDOfEnrollees = Convert.ToString(Console.ReadLine());
                                            //arrayForStudents={ "\""+nameOfEnrollees+",\""+BirthOfEnrollees+",\""+GenderOfEnrollees+",\""+AddressOfEnrollees+",\""+IDOfEnrollees+"\""};
                                        }
                                        Console.WriteLine("Press 1 to Continue, 2 to return to main menu or 0 to exit");
                                        endOrRestart = Convert.ToString(Console.ReadLine());
                                        if (endOrRestart == "2")
                                            goto Start;
                                        else if (endOrRestart == "1")
                                        {
                                            goto IncorrectInput1;
                                        }
                                        else
                                            goto end;


                                    }
                                    else
                                    {
                                        goto IncorrectInput1;
                                    }

                                case "2":
                                    Console.WriteLine("View all enrolled students\nCurrently Under Development");
                                    incorrectOption2 = false;
                                    break;
                                case "3":
                                    Console.WriteLine("Update student information\nCurrently Under Developmwnt");
                                    incorrectOption2 = false;
                                    break;
                                case "4":
                                    Console.WriteLine("Delete Student by ID\nCurrently Under Development");
                                    incorrectOption2 = false;
                                    break;
                                case "5":
                                    Console.WriteLine("Number of Students Enrolled\nCurrently Under Development");
                                    incorrectOption2 = false;
                                    break;
                                case "6":
                                    Console.WriteLine("Clear Databsae\nCurrently Under Development");
                                    incorrectOption2 = false;
                                    break;
                                case "7":
                                    Console.WriteLine("Go Back to Main Menu");
                                    goto Start;
                                default:
                                    incorrectOption2 = true;
                                    break;
                            }
                        }
                        break;
                    case "2":
                        //for employees
                        bool incorrectOption3 = true;
                        while (incorrectOption3)
                        {
                        //labeling for incorrect input on option for hiring
                        IncorrectInput2:
                            Console.WriteLine("1. Hire Employees\n2. View All Employees\n3. Update Employee Information\n4. Delete Employee Information by ID" +
                    "\n5. Clear Database\n6. Go Back to Main Menu:");
                            incorrectOption1 = false;
                            string selectEmployeeOption = Convert.ToString(Console.ReadLine());
                            switch (selectEmployeeOption)
                            {
                                case "1":
                                    incorrectOption3 = false;
                                    //for hiring employees
                                    Console.WriteLine("Enter Number of Employees: ");
                                    string numOfEmployees = Console.ReadLine();
                                    int num2 = 1;
                                    //humman error catch
                                    if (int.TryParse(numOfEmployees, out num2))
                                    {
                                        //for loop here
                                        for (int nOE = 0; nOE < Convert.ToInt32(numOfEmployees); nOE++)
                                        {
                                            Console.WriteLine("Enter Name");
                                            string nameOfEmployees = Convert.ToString(Console.ReadLine());

                                            Console.WriteLine("Enter Birth Date");
                                            string birthOfEmployees = Convert.ToString(Console.ReadLine());
                                            Console.WriteLine("Enter Gender");
                                            string genderOfEmployees = Convert.ToString(Console.ReadLine());
                                            Console.WriteLine("Enter Address");
                                            string addressOfEmployees = Convert.ToString(Console.ReadLine());
                                            Console.WriteLine("Enter Employee ID");
                                            string IDOfEmployees = Convert.ToString(Console.ReadLine());
                                            Console.WriteLine("Occupation");
                                            string occupationOfEmployees = Convert.ToString(Console.ReadLine());
                                            Console.WriteLine("Salary\nPHP");
                                            string Peso = Convert.ToString(Console.ReadLine());
                                            Console.WriteLine("Schedule:\n\t[1] 8:00 AM - 5:00 PM\n\t[2] 12:00 NN - 8:00 PM");//sched
                                            string scheduleOfEmployees = Convert.ToString(Console.ReadLine());
                                        }
                                        Console.WriteLine("Press 1 to Continue, 2 to return to main menu or 0 to exit");
                                        endOrRestart = Convert.ToString(Console.ReadLine());
                                        if (endOrRestart == "2")
                                            goto Start;
                                        else if (endOrRestart == "1")
                                        {
                                            goto IncorrectInput2;
                                        }
                                        else
                                            goto end;
                                    }
                                    else
                                    {
                                        goto IncorrectInput2;
                                    }

                                case "2":
                                    Console.WriteLine("View All Employees\nUnder Development");
                                    incorrectOption3 = false;
                                    break;
                                case "3":
                                    Console.WriteLine("Update Employee Information\nUnder Development");
                                    incorrectOption3 = false;
                                    break;
                                case "4":
                                    Console.WriteLine("Delete Employee Information by ID\nUnder Development");
                                    incorrectOption3 = false;
                                    break;
                                case "5":
                                    Console.WriteLine("Clear Database\nUnder Development");
                                    incorrectOption3 = false;
                                    break;
                                case "6":
                                    Console.WriteLine("Go Back to Main Menu");
                                    goto Start;
                                default:
                                    incorrectOption3 = true;
                                    break;
                            }
                }

                        break;
                    default:
                        Console.WriteLine("Invalid Input!\n");
                        break;

                }
            }
        end:
            Console.WriteLine("exiting");

        }

    }
}

Recommended Answers

All 2 Replies

It seems odd to use the console for input/output like but no, it's not clear at all what your issue is yet.

That's over 200 lines long so my suggestion is to supply a "minimum viable example" of the problem as well as rewrite the question.

commented: it is is the code line 51 to 63 +0

The code on lines 51 to 63 seems fine as to asking and getting some information from the user. But the topic doesn't seem to mesh with those lines.

Where is the code for " add the value as simple as interting values in the database." (that really needs rewording as it's a bit muddled.)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.