示例#1
0
    // V 1.0.0
    public CurriculumGeneralData getCurriculum(string Curriculum_Code)
    {
        CurriculumGeneralData Curriculum_data = new CurriculumGeneralData();

        try
        {
            string curr_year = "";
            string curr_code = "";


            curr_year = Curriculum_Code.Substring(0, 4);
            curr_code = Curriculum_Code.Substring(4);



            ConnectDB     db        = new ConnectDB();
            SqlDataSource oracleObj = db.ConnectionOracle_tqf2();
            oracleObj.SelectCommand = "Select * From CURRICULUM Where CURRCODE='" + curr_code + "' AND YEARVERSION='" + curr_year + "'";
            DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty);
            foreach (DataRowView rowData in allData)
            {
                Curriculum_data.Curr_Code       = rowData["CURRCODE"].ToString();
                Curriculum_data.Curr_Year       = rowData["YEARVERSION"].ToString();
                Curriculum_data.Faculty_Code    = rowData["FACULTYCODE"].ToString();
                Curriculum_data.Department_Code = rowData["DEPARTMENTCODE"].ToString();
                //Curriculum_data.Major_Code = rowData["DIVISIONCODE"].ToString();
                Curriculum_data.Curr_ThaiName = rowData["CURRTHNAME"].ToString();
                Curriculum_data.Curr_EngName  = rowData["CURRENNAME"].ToString();
                Curriculum_data.Degree_Level  = rowData["LEVELCODE"].ToString();

                if (Curriculum_data.Degree_Level == "01")
                {
                    Curriculum_data.Degree_Char = "U";
                }
                else if (Curriculum_data.Degree_Level == "02")
                {
                    Curriculum_data.Degree_Char = "B";
                }
                else if (Curriculum_data.Degree_Level == "03")
                {
                    Curriculum_data.Degree_Char = "M";
                }
                else if (Curriculum_data.Degree_Level == "04")
                {
                    Curriculum_data.Degree_Char = "D";
                }
                else if (Curriculum_data.Degree_Level == "05")
                {
                    Curriculum_data.Degree_Char = "P";
                }
            }
        }
        catch
        {
        }
        return(Curriculum_data);
    }
示例#2
0
    // V 1.0.0
    public List <CurriculumGeneralData> getManualCurriculum(string Sql_Command)
    {
        List <CurriculumGeneralData> Curriculum_data = new List <CurriculumGeneralData>();

        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        oracleObj.SelectCommand = Sql_Command;
        DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty);

        foreach (DataRowView rowData in allData)
        {
            CurriculumGeneralData Curriculum = new CurriculumGeneralData();
            Curriculum.Curr_Code       = rowData["CURRCODE"].ToString();
            Curriculum.Curr_Year       = rowData["YEARVERSION"].ToString();
            Curriculum.Faculty_Code    = rowData["FACULTYCODE"].ToString();
            Curriculum.Department_Code = rowData["DEPARTMENTCODE"].ToString();
            Curriculum.Major_Code      = rowData["DIVISIONNO"].ToString();
            Curriculum.Curr_ThaiName   = rowData["CURRTHNAME"].ToString();
            Curriculum.Curr_EngName    = rowData["CURRENNAME"].ToString();
            Curriculum.Degree_Level    = rowData["LEVELCODE"].ToString();

            if (Curriculum.Degree_Level == "01")
            {
                Curriculum.Degree_Char = "U";
            }
            else if (Curriculum.Degree_Level == "02")
            {
                Curriculum.Degree_Char = "B";
            }
            else if (Curriculum.Degree_Level == "03")
            {
                Curriculum.Degree_Char = "M";
            }
            else if (Curriculum.Degree_Level == "04")
            {
                Curriculum.Degree_Char = "D";
            }
            else if (Curriculum.Degree_Level == "05")
            {
                Curriculum.Degree_Char = "P";
            }

            Curriculum_data.Add(Curriculum);
        }

        return(Curriculum_data);
    }
示例#3
0
    // V 1.0.0
    public List <CurriculumGeneralData> getCurriculum_Degree(string degree_char)
    {
        List <CurriculumGeneralData> Curriculum_data = new List <CurriculumGeneralData>();
        string        degree_level = "";
        ConnectDB     db           = new ConnectDB();
        SqlDataSource oracleObj    = db.ConnectionOracle_tqf2();

        if (degree_char == "U")
        {
            degree_level = "01";
        }
        else if (degree_char == "B")
        {
            degree_level = "02";
        }
        else if (degree_char == "M")
        {
            degree_level = "03";
        }
        else if (degree_char == "D")
        {
            degree_level = "04";
        }
        else if (degree_char == "P")
        {
            degree_level = "05";
        }

        oracleObj.SelectCommand = "Select * From CURRICULUM Where LEVELCODE = '" + degree_level + "' AND CURRCODE !='999999999' AND APPROVESTATUS='Y' Order By CURRCODE";
        DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty);

        foreach (DataRowView rowData in allData)
        {
            CurriculumGeneralData Curriculum = new CurriculumGeneralData();
            Curriculum.Curr_Code       = rowData["CURRCODE"].ToString();
            Curriculum.Curr_Year       = rowData["YEARVERSION"].ToString();
            Curriculum.Faculty_Code    = rowData["FACULTYCODE"].ToString();
            Curriculum.Department_Code = rowData["DEPARTMENTCODE"].ToString();
            //Curriculum.Major_Code = rowData["DIVISIONCODE"].ToString();
            Curriculum.Curr_ThaiName = rowData["CURRTHNAME"].ToString();
            Curriculum.Curr_EngName  = rowData["CURRENNAME"].ToString();
            Curriculum.Degree_Level  = rowData["LEVELCODE"].ToString();

            if (Curriculum.Degree_Level == "01")
            {
                Curriculum.Degree_Char = "U";
            }
            else if (Curriculum.Degree_Level == "02")
            {
                Curriculum.Degree_Char = "B";
            }
            else if (Curriculum.Degree_Level == "03")
            {
                Curriculum.Degree_Char = "M";
            }
            else if (Curriculum.Degree_Level == "04")
            {
                Curriculum.Degree_Char = "D";
            }
            else if (Curriculum.Degree_Level == "05")
            {
                Curriculum.Degree_Char = "P";
            }

            Curriculum_data.Add(Curriculum);
        }

        return(Curriculum_data);
    }
示例#4
0
    protected void onclick_section1(object sender, EventArgs e)
    {
        try
        {
            uint chknum;
            AvailableCourseData available_data = new AvailableCourseData();

            available_data.AcademicYear = txtACADEMIC_YEAR.Text;
            available_data.Semester     = ddlSEMESTER.SelectedValue;
            available_data.Faculty_Code = ddlFACULTY.SelectedValue;
            if (rbt1.Checked)
            {
                CurriculumGeneralData curr_data = new CurriculumGeneralData();
                curr_data = new Curriculum().getCurriculum(ddlCURRICULUM.SelectedValue);
                available_data.Curr_Code       = ddlCURRICULUM.SelectedValue;
                available_data.Department_Code = curr_data.Department_Code;
                available_data.Major_Code      = curr_data.Major_Code;
            }
            else if (rbt2.Checked)
            {
                available_data.Curr_Code = ddlServiceCURRICULUM.SelectedValue;
            }

            available_data.Status = "0601";

            Session["service_course"] = rbt2.Checked;
            Session["save_data"]      = available_data;

            if (rbt1.Checked)
            {
                if (txtACADEMIC_YEAR.Text.Length != 4)
                {
                    MsgValidate("โปรดระบุ ปีการศึกษาเป็นตัวเลขจำนวน 4 ตัว");
                }
                else if (!uint.TryParse(txtACADEMIC_YEAR.Text, out chknum))
                {
                    MsgValidate("โปรดระบุ ปีการศึกษาเป็นตัวเลขเท่านั้น");
                }
                else if (ddlSEMESTER.SelectedValue == "0")
                {
                    MsgValidate("โปรดระบุ ภาคการศึกษา");
                }
                else if (ddlDEGREE.SelectedValue == "0")
                {
                    MsgValidate("โปรดระบุ ระดับการศึกษา");
                }
                else if (ddlCURRICULUM.SelectedValue == "0")
                {
                    MsgValidate("โปรดระบุ หลักสูตร");
                }
                else
                {
                    Response.Redirect("add_Section2.aspx");
                }
            }
            else if (rbt2.Checked)
            {
                if (txtACADEMIC_YEAR.Text.Length != 4)
                {
                    MsgValidate("โปรดระบุ ปีการศึกษาเป็นตัวเลขจำนวน 4 ตัว");
                }
                else if (!uint.TryParse(txtACADEMIC_YEAR.Text, out chknum))
                {
                    MsgValidate("โปรดระบุ ปีการศึกษาเป็นตัวเลขเท่านั้น");
                }
                else if (ddlSEMESTER.SelectedValue == "0")
                {
                    MsgValidate("โปรดระบุ ภาคการศึกษา");
                }
                else if (ddlDEGREE.SelectedValue == "0")
                {
                    MsgValidate("โปรดระบุ ระดับการศึกษา");
                }
                else if (ddlServiceCURRICULUM.SelectedValue == "0")
                {
                    MsgValidate("โปรดระบุ หลักสูตร");
                }
                else
                {
                    Response.Redirect("add_Section2.aspx");
                }
            }
        }
        catch
        {
            MsgValidate("ไม่สามารถดำเนินการได้");
        }
    }