Example #1
0
        private void LoadMockRecord()
        {
            //그리드속성
            MockGrid.AutoGenerateColumns = false;
            MockGrid.AllowUserToAddRows  = false;
            MockGrid.MultiSelect         = true;
            MockGrid.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;
            MockGrid.RowHeadersWidth     = 15;
            MockGrid.ColumnHeadersHeight = 20;
            MockGrid.ColumnHeadersDefaultCellStyle.Font = new Font("Segoe UI", 9.5F);
            MockGrid.RowsDefaultCellStyle.Font          = new Font("Segoe UI", 9.5F);
            UtilityClass.AddNewColumnToDataGridView(MockGrid, "학년", "grade", true, 60);
            UtilityClass.AddNewColumnToDataGridView(MockGrid, "국어", "korean", true, 60);
            UtilityClass.AddNewColumnToDataGridView(MockGrid, "영어", "english", true, 60);
            UtilityClass.AddNewColumnToDataGridView(MockGrid, "수학", "math", true, 60);
            UtilityClass.AddNewColumnToDataGridView(MockGrid, "사회/과학1", "side_choice1", true, 100);
            UtilityClass.AddNewColumnToDataGridView(MockGrid, "사회/과학2", "side_choice2", true, 100);
            UtilityClass.AddNewColumnToDataGridView(MockGrid, "제2외국어", "more_foreign", true, 90);
            UtilityClass.AddNewColumnToDataGridView(MockGrid, "평균", "total_avg", true, 60);
            UtilityClass.AddNewColumnToDataGridView(MockGrid, "등급컷", "cut", true, 70);

            SchoolRecordInfoDAC DAC = new SchoolRecordInfoDAC();
            DataSet             ds  = DAC.GetMockRecordAvg(lblStudentID.Text);

            MockGrid.DataSource = ds.Tables[0];
            MockGrid.ClearSelection();
            DAC.Dispose();
        }
Example #2
0
        private void LoadCMockhart()
        {
            chartMock.Series.Clear();

            chartMock.Series.Add(new Series("Series1"));
            chartMock.Series.Add(new Series("Series2"));
            chartMock.Series.Add(new Series("Series3"));
            chartMock.Series.Add(new Series("Series4"));
            chartMock.Series.Add(new Series("Series5"));
            chartMock.Series.Add(new Series("Series6"));

            SchoolRecordInfoDAC dac = new SchoolRecordInfoDAC();
            DataSet             ds  = dac.GetMockChart(lblStudentID.Text);

            DataView dv = new DataView(ds.Tables[0]);

            //DataTable 객체를 DataSource에 지정하고
            //x,y축 컬럼을 xValueMember와 YValueMember에 지정
            chartMock.Series[0].Points.DataBind(dv, "grade", "korean", "Tooltip=korean");
            chartMock.Series[1].Points.DataBind(dv, "grade", "english", "Tooltip=english");
            chartMock.Series[2].Points.DataBind(dv, "grade", "math", "Tooltip=math");
            chartMock.Series[3].Points.DataBind(dv, "grade", "side_choice1", "Tooltip=side_choice1");
            chartMock.Series[4].Points.DataBind(dv, "grade", "side_choice2", "Tooltip=side_choice2");
            chartMock.Series[5].Points.DataBind(dv, "grade", "more_foreign", "Tooltip=more_foreign");

            chartMock.Series[0].LegendText = "국어";
            chartMock.Series[1].LegendText = "영어";
            chartMock.Series[2].LegendText = "수학";
            chartMock.Series[3].LegendText = "사회/과학1";
            chartMock.Series[4].LegendText = "사회/과학2";
            chartMock.Series[5].LegendText = "제2외국어";
        }
Example #3
0
        private void LoadPossibleMockUniv()
        {
            //그리드속성
            SchoolUnivCutGrid.AutoGenerateColumns = false;
            SchoolUnivCutGrid.AllowUserToAddRows  = false;
            SchoolUnivCutGrid.MultiSelect         = true;
            SchoolUnivCutGrid.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;
            SchoolUnivCutGrid.RowHeadersWidth     = 15;
            SchoolUnivCutGrid.ColumnHeadersHeight = 20;
            SchoolUnivCutGrid.ColumnHeadersDefaultCellStyle.Font = new Font("Segoe UI", 9.5F);
            SchoolUnivCutGrid.RowsDefaultCellStyle.Font          = new Font("Segoe UI", 9.5F);
            UtilityClass.AddNewColumnToDataGridView(SchoolUnivCutGrid, "대학", "univ_name", true, 130);
            UtilityClass.AddNewColumnToDataGridView(SchoolUnivCutGrid, "학과", "major_name", true, 143);
            UtilityClass.AddNewColumnToDataGridView(SchoolUnivCutGrid, "등급컷", "cut", true, 80);

            SchoolRecordInfoDAC DAC = new SchoolRecordInfoDAC();

            if (mockrowIndex == 0 && mockcellIndex == 0)
            {
                return;
            }
            DataSet ds = DAC.GetPossibleUnivCutLine(Convert.ToInt32(MockGrid.Rows[mockrowIndex].Cells[mockcellIndex].Value));

            SchoolUnivCutGrid.DataSource = ds.Tables[0];

            SchoolUnivCutGrid.ClearSelection();
            DAC.Dispose();
        }
Example #4
0
        private void LoadData()
        {
            SchoolRecordInfoDAC dac = new SchoolRecordInfoDAC();
            DataSet             ds  = dac.GetAllMock(lblStudentID.Text);

            MockGrid.DataSource = ds.Tables[0];

            dac.Dispose();
        }
Example #5
0
        private void LoadUnivCutLine()
        {
            SchoolRecordInfoDAC dac = new SchoolRecordInfoDAC();
            DataSet             ds  = dac.GetUnivCutLine(lblUniversityName.Text.Trim(), lblMajorName.Text.Trim());

            UnivCutGrid.DataSource = ds.Tables[0];
            UnivCutGrid.ClearSelection();
            dac.Dispose();
        }
Example #6
0
        private void LoadRecordAvgData()
        {
            SchoolRecordInfoDAC dac = new SchoolRecordInfoDAC();
            DataSet             ds  = dac.GetMockRecordAvg(lblStudentID.Text);

            RecordGrid.DataSource = ds.Tables[0];
            RecordGrid.ClearSelection();
            dac.Dispose();
        }
        private void LoadSchoolData() //내신
        {
            SchoolRecordInfoDAC dac = new SchoolRecordInfoDAC();
            DataSet             ds  = dac.GetAllSchool(lblStudentID.Text);

            SchoolRecordGrid.DataSource = ds.Tables[0];

            dac.Dispose();
        }
Example #8
0
 private void BtnDeleteRecord_Click(object sender, EventArgs e)
 {
     try
     {
         if (MaterialMessageBox.Show("삭제하시겠습니까?", "삭제확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             SchoolRecordInfoDAC dac = new SchoolRecordInfoDAC();
             dac.DeleteSchool(RecordGrid[5, RecordGrid.CurrentRow.Index].Value.ToString());
             dac.Dispose();
             LoadData();
             LoadChart();
         }
     }
     catch (Exception err)
     {
         MessageBox.Show(err.Message);
     }
 }
Example #9
0
        private void BtnCreateRecord_Click(object sender, EventArgs e)
        {
            MockRecordInsUpForm frm = new MockRecordInsUpForm(lblStudentID.Text, lblStudentName.Text);

            try
            {
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    SchoolRecordInfoDAC DAC = new SchoolRecordInfoDAC();
                    DAC.InsertMock(frm.MockRecordInfo);
                    DAC.Dispose();
                    MaterialMessageBox.Show("신규등록이 완료되었습니다.", "확인", MessageBoxButtons.OK);
                    LoadData();
                    LoadChart();
                }
            }
            catch (Exception err)
            {
                MetroFramework.MetroMessageBox.Show(this, err.Message, "경고");
            }
        }
Example #10
0
        private void LoadChart()
        {
            chartSchool.Series.Clear();

            chartSchool.Series.Add(new Series("Series1"));
            chartSchool.Series.Add(new Series("Series2"));
            chartSchool.Series.Add(new Series("Series3"));

            SchoolRecordInfoDAC dac = new SchoolRecordInfoDAC();
            DataSet             ds  = dac.GetSchoolChart(lblStudentID.Text);

            DataView dv = new DataView(ds.Tables[0]);


            //DataTable 객체를 DataSource에 지정하고
            //x,y축 컬럼을 xValueMember와 YValueMember에 지정
            chartSchool.Series[0].Points.DataBind(dv, "grade", "korean", "Tooltip=korean");
            chartSchool.Series[1].Points.DataBind(dv, "grade", "english", "Tooltip=english");
            chartSchool.Series[2].Points.DataBind(dv, "grade", "math", "Tooltip=math");

            chartSchool.Series[0].LegendText = "국어";
            chartSchool.Series[1].LegendText = "영어";
            chartSchool.Series[2].LegendText = "수학";
        }
Example #11
0
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            if (radiobtnSchool.Checked == true) //내신성적
            {
                if (cmbGrade.SelectedItem is null)
                {
                    MaterialMessageBox.Show("학년을 선택해주세요.", "경고", MessageBoxButtons.OK);
                    return;
                }

                if (cmbSemester.SelectedItem is null)
                {
                    MaterialMessageBox.Show("학기 선택해주세요.", "경고", MessageBoxButtons.OK);
                    return;
                }

                //성적 데이터그리드뷰
                RecordGrid.Columns.Clear();
                RecordGrid.ClearSelection();
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "이름", "std_name", true, 80);
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "국어", "sch_korean", true, 100);
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "영어", "sch_english", true, 100);
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "수학", "sch_math", true, 100);
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "평균", "avg", true, 100);
                RecordGrid.Columns[4].DefaultCellStyle.BackColor = Color.Yellow; //평균 컬럼은 노란색으로

                SchoolRecordInfoDAC DAC = new SchoolRecordInfoDAC();
                DataSet             ds  = DAC.GetSchoolRecordByScore(cmbGrade.SelectedItem.ToString(), cmbSemester.SelectedItem.ToString());
                RecordGrid.DataSource = ds.Tables[0];

                DAC.Dispose();
            }
            else if (radiobtnMock.Checked == true) //모의고사성적
            {
                if (cmbGrade.SelectedItem is null)
                {
                    MaterialMessageBox.Show("학년을 선택해주세요.", "경고", MessageBoxButtons.OK);
                    return;
                }

                if (cmbSemester.SelectedItem is null)
                {
                    MaterialMessageBox.Show("월을 선택해주세요.", "경고", MessageBoxButtons.OK);
                    return;
                }
                RecordGrid.Columns.Clear();
                RecordGrid.ClearSelection();
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "이름", "std_name", true, 70);
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "국어", "sch_korean", true, 60);
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "영어", "sch_english", true, 60);
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "수학", "sch_math", true, 60);
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "사회/과학1", "side_choice1", true, 85);
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "사회/과학2", "side_choice2", true, 85);
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "제2외국어", "more_foreign", true, 80);
                UtilityClass.AddNewColumnToDataGridView(RecordGrid, "평균", "avg", true, 80);
                RecordGrid.Columns[7].DefaultCellStyle.BackColor = Color.Yellow;


                SchoolRecordInfoDAC DAC = new SchoolRecordInfoDAC();
                DataSet             ds  = DAC.GetMockRecordByScore(cmbGrade.SelectedItem.ToString(), cmbSemester.SelectedItem.ToString());
                RecordGrid.DataSource = ds.Tables[0];

                DAC.Dispose();
            }
        }