using System;
using System.Data;
using System.Configuration;
using core.DataAccessLayer;
using System.Collections.Generic;

using System.Collections;

using Paper.DataAccessLayer;
using core.BusinessObject;
using Paper.BusinessObject;


/// <summary>
/// PaperManager 的摘要说明
/// </summary>
/// 
namespace core.BusinessLogicLayer
{
    public class PaperManager
    {
        public PaperManager()
        {
        }
       
        public string SelectTeacherName()
        {
            string jsons = "[";

            List<Teacher> teachers = new TeacherDAO().SelectAll();

            foreach (Teacher teacher in teachers)
            {
                jsons += "['" + teacher.TeacherID + "','" + teacher.TeacherName + "'],";
            }
            jsons = jsons.Substring(0, jsons.Length - 1);
            jsons += "]";
            return jsons;
        }

        public string selectDifficultFactor()
        {
            string jsons = "[";

            List<core.BusinessObject.Course> courses = courseNameDataAccess.selectDifficultFactor();

            foreach (core.BusinessObject.Course course in courses)
            {
                jsons += "['" + course.teacherName + "','" + course.teacherName + "'],";
            }
            jsons = jsons.Substring(0, jsons.Length - 1);
            jsons += "]";
            return jsons;
        }

        public string selectThemeType()
        {
            string jsons = "[";

            List<core.BusinessObject.Course> courses = courseNameDataAccess.selectThemeType();

            foreach (core.BusinessObject.Course course in courses)
            {
                jsons += "['" + course.themeType + "','" + course.themeType + "'],";
            }
            jsons = jsons.Substring(0, jsons.Length - 1);
            jsons += "]";
            return jsons;
        }

        public string selectCourseChapter()
        {
            string jsons = "[";

            List<core.BusinessObject.Course> courses = courseNameDataAccess.selectCourseChapter();

            foreach (core.BusinessObject.Course course in courses)
            {
                jsons += "['" + course.courseChapter + "','" + course.courseChapter + "'],";
            }
            jsons = jsons.Substring(0, jsons.Length - 1);
            jsons += "]";
            return jsons;
        }

        public string SelectCourseName()
        {
            string jsons = "[";

            List<Paper.BusinessObject.Course> courses = new CourseDAO().SelectAll();

            foreach (Paper.BusinessObject.Course course in courses)
            {
                jsons += "['" + course.CourseID + "','" + course.CourseName + "'],";
            }
            jsons = jsons.Substring(0,jsons.Length-1);
            jsons += "]";
            return jsons;
        }
    }
}