public void QueryByCourse()
        {
            Course courseObj = new Course();

            courseUI.Query();

            Console.Write("Enter Course ID: ");
            courseObj.ID = int.Parse(Console.ReadLine());

            registraionData.QueryByCourse(courseObj);
        }
        public void Insert()
        {
            Course courseObj = new Course();

            Console.Write("Enter Name: ");
            courseObj.NAME = Console.ReadLine();

            courseData.Insert(courseObj);

            Query();
        }
        public void Insert(Course courseObj)
        {
            string insertQuery = "INSERT INTO Course (NAME) VALUES(@NAME)";

            SqlCommand insertCommand = new SqlCommand(insertQuery);

            SqlParameter nameParam = new SqlParameter("@NAME", SqlDbType.NVarChar, 50);
            nameParam.Value = courseObj.NAME;

            insertCommand.Parameters.Add(nameParam);

            dataAccess.Execute(insertCommand);
        }
        public void Update(Course courseObje)
        {
            string updateQuery = "UPDATE Course SET NAME = @NAME WHERE ID = @ID";

            SqlCommand updateCommand = new SqlCommand(updateQuery);

            SqlParameter idParam = new SqlParameter("@ID", SqlDbType.Int);
            idParam.Value = courseObje.ID;

            SqlParameter nameParam = new SqlParameter("@NAME", SqlDbType.NVarChar, 50);
            nameParam.Value = courseObje.NAME;

            updateCommand.Parameters.Add(idParam);
            updateCommand.Parameters.Add(nameParam);

            dataAccess.Execute(updateCommand);
        }
        public void QueryByCourse(Course courseObj)
        {
            string courseQuery = "SELECT * FROM Course WHERE ID = @ID";
            string registraionQuery = "SELECT STUDENTID FROM Registraton WHERE COURSEID = @ID";

            SqlCommand courseCommand = new SqlCommand(courseQuery);
            SqlCommand registraionCommand = new SqlCommand(registraionQuery);

            SqlParameter courseIDParam = new SqlParameter("@ID", SqlDbType.Int);
            SqlParameter regCourseIDParam = new SqlParameter("@ID", SqlDbType.Int);

            courseIDParam.Value = courseObj.ID;
            regCourseIDParam.Value = courseObj.ID;

            courseCommand.Parameters.Add(courseIDParam);
            registraionCommand.Parameters.Add(regCourseIDParam);

            Console.WriteLine("Course Info: ");
            CommonUI.ShowTable(dataAccess.Query(courseCommand));

            Console.WriteLine("Registration Info: ");

            ShowStudentName(dataAccess.Query(registraionCommand));
        }
        public void Update()
        {
            Course courseObj = new Course();

            Console.Write("Enter ID: ");
            courseObj.ID = int.Parse(Console.ReadLine());

            Console.Write("Enter Name: ");
            courseObj.NAME = Console.ReadLine();

            courseData.Update(courseObj);

            Query();
        }