Exemple #1
0
        private void TileSave_Click(object sender, EventArgs e)
        {
            StudentDetailInfoVO stdDetail;

            StudentDetailInfoDAC dac = new StudentDetailInfoDAC();

            stdDetail.Id        = txtStudentID.Text;
            stdDetail.Zipcode   = addressUserControl2.Zipcode.Trim();
            stdDetail.Address1  = addressUserControl2.Address1.Trim();
            stdDetail.Address2  = addressUserControl2.Address2.Trim();
            stdDetail.FreeStudy = cmbMain1.SelectedItem.ToString();
            stdDetail.MoreStudy = cmbMain2.SelectedItem.ToString();
            stdDetail.Academy   = cmbMain3.SelectedItem.ToString();
            stdDetail.Major     = txtMajor.Text.Trim();
            stdDetail.Job       = txtJob.Text.Trim();
            stdDetail.Hobby     = txtHobby.Text.Trim();
            stdDetail.Circle    = txtCircle.Text.Trim();
            stdDetail.Note      = txtNote.Text.Trim();

            dac.SaveToDB(stdDetail);
            dac.Dispose();

            MaterialMessageBox.Show("저장되었습니다.", "저장", MessageBoxButtons.OK);
            LoadStudentDetailInfoData();

            bool bCheck = false;

            EnabledControl(bCheck);
        }
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            bool bCheck = false;

            for (int i = 0; i < StudentGrid.RowCount; i++)
            {
                if (StudentGrid.Rows[i].Cells[1].Value.ToString() == txtFindName.Text.Trim())
                {
                    StudentGrid.ClearSelection();
                    StudentGrid.Rows[i].Selected = true;
                    bCheck = true;

                    lblStudentID.Text   = StudentGrid.Rows[i].Cells[0].Value.ToString();
                    lblStudentName.Text = StudentGrid.Rows[i].Cells[1].Value.ToString();

                    LoadSchoolData();
                    LoadMockData();
                }
            }

            if (!bCheck)
            {
                MaterialMessageBox.Show("존재하지 않는 학생입니다.", "삭제확인", MessageBoxButtons.OK);
            }

            txtFindName.Text = "";
        }
Exemple #3
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     if (txtStudentID.Text.Length < 1 || txtStudentName.Text.Length < 1)
     {
         MaterialMessageBox.Show("아이디,이름을 확인해주세요", "경고", MessageBoxButtons.OK);
         return;
     }
     else
     {
         this.DialogResult = DialogResult.OK;
     }
 }
 private void BtnUnivSearch_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtUnivSearch.Text))
     {
         LoadUnivData();
         txtUnivSearch.Text = "";
     }
     else
     {
         MaterialMessageBox.Show("학교를 입력해주세요.", "경고", MessageBoxButtons.OK);
     }
 }
Exemple #5
0
        //네비게이터의 저장버튼
        private void ToolStripButton1_Click(object sender, EventArgs e)
        {
            if (AwardGrid.Rows.Count == 0)
            {
                if (string.IsNullOrEmpty(txtAwarddetails.Text) && AwardGrid.Rows.Count > 0)
                {
                    MaterialMessageBox.Show("수상내역을 입력해주세요.", "경고", MessageBoxButtons.OK);
                    return;
                }
            }
            CompetitionInfoService service = new CompetitionInfoService();

            try
            {
                DataRow[] insRows = dt.Select(null, null, DataViewRowState.Added);
                foreach (DataRow dr in insRows)
                {
                    CompetitionInfoVO item = SetInsertAwardInfoVo(dr);
                    service.Insert(item, lblStudentID.Text);
                }
                DataRow[] upsRows = dt.Select(null, null, DataViewRowState.ModifiedCurrent);

                foreach (DataRow dr in upsRows)
                {
                    CompetitionInfoVO item = SetAwardInfoVo(dr);
                    service.Update(item, lblStudentID.Text);
                }


                DataRow[] delRows = dt.Select(null, null, DataViewRowState.Deleted);

                foreach (DataRow dr in delRows)
                {
                    CompetitionInfoVO item = SetDelAwardInfoVo(dr);
                    service.Delete(item, lblStudentID.Text);
                }

                MaterialMessageBox.Show("저장완료", "확인", MessageBoxButtons.OK);
            }
            catch (InvalidCastException)
            {
                MaterialMessageBox.Show("항목을 입력해주세요", "경고", MessageBoxButtons.OK);
            }
            catch (Exception err)
            {
                MaterialMessageBox.Show(err.Message, "경고", MessageBoxButtons.OK);
            }
            finally
            {
                service.Dispose();
            }
        }
Exemple #6
0
        private void TileUniversity_Click(object sender, EventArgs e)
        {
            bool bCheck = FormOverFlowCheck("UniversityForm");

            if (!bCheck)
            {
                MaterialMessageBox.Show("이미열려있는 화면입니다.", "경고", MessageBoxButtons.OK);
                return;
            }
            UniversityForm frm = new UniversityForm(txtStudentID.Text, txtStudentName.Text);

            frm.Show();
        }
Exemple #7
0
        private void 직업리스트ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool bCheck = FormOverFlowCheck("JobListForm");

            if (!bCheck)
            {
                MaterialMessageBox.Show("이미열려있는 화면입니다.", "경고", MessageBoxButtons.OK);
                return;
            }
            JobListForm frm = new JobListForm();

            frm.Show();
        }
Exemple #8
0
        private void 성적순조회ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool bCheck = FormOverFlowCheck("RecordByScoreForm");

            if (!bCheck)
            {
                MaterialMessageBox.Show("이미열려있는 화면입니다.", "경고", MessageBoxButtons.OK);
                return;
            }
            RecordByScoreForm frm = new RecordByScoreForm();

            frm.Show();
        }
        private void TxtKorean_KeyPress(object sender, KeyPressEventArgs e)
        {
            bool bCheck = Char.IsDigit(e.KeyChar) || (e.KeyChar == '.') || (e.KeyChar == Convert.ToChar(Keys.Back));

            if (!bCheck)
            {
                string val = "true";
                if (val.ToLower() == "true")
                {
                    MaterialMessageBox.Show("숫자를 입력하세요.", "경고", MessageBoxButtons.OK);
                }
                e.Handled = true;
            }
        }
Exemple #10
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     if (txtKorean.Text.Length < 1 || txtMath.Text.Length < 1 || txtKorean.Text.Length < 1)
     {
         MaterialMessageBox.Show("점수를 입력해주세요.", "경고", MessageBoxButtons.OK);
         return;
     }
     else if (Convert.ToDouble(txtKorean.Text) > 100 || Convert.ToDouble(txtEnglish.Text) > 100 || Convert.ToDouble(txtMath.Text) > 100)
     {
         MaterialMessageBox.Show("점수는 100점을 넘을수 없습니다.", "경고", MessageBoxButtons.OK);
         return;
     }
     else
     {
         this.DialogResult = DialogResult.OK;
     }
 }
 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);
     }
 }
Exemple #12
0
        private void BtnSaveFile_Click(object sender, EventArgs e)
        {
            if (pictureBox1.Image == null)
            {
                MaterialMessageBox.Show("저장하실 이미지 정보를 입력하여 주십시오", "오류", MessageBoxButtons.OK);
                return;
            }
            //Cursor currentCursor = this.Cursor;
            string destFile  = string.Empty;
            string sPath     = string.Empty;
            string sFileName = string.Empty;
            string sExt      = string.Empty;

            try
            {
                //this.Cursor = Cursors.WaitCursor;
                StudentInfoDAC stdDB     = new StudentInfoDAC();
                string         localFile = pictureBox1.Tag.ToString().Replace("\\", "/");
                sPath     = string.Format("studentImage/{0}/", txtStudentID.Text);
                sExt      = localFile.Substring(localFile.LastIndexOf("."));
                sFileName = DateTime.Now.ToString("yyyyMMddHHmmss") + txtStudentID.Text + sExt;

                DirectoryInfo di = new DirectoryInfo(sPath);
                if (di.Exists == false)
                {
                    di.Create();
                }
                // 현재 exe가 실행중인 경로에 생성
                destFile = Path.Combine(Environment.CurrentDirectory.Replace("\\", "/"), sPath, sFileName);
                File.Copy(pictureBox1.Tag.ToString(), destFile, true);

                stdDB.SaveImageFile(sPath, sFileName, txtStudentID.Text);
                stdDB.Dispose();
                MaterialMessageBox.Show("사진저장 완료", "확인", MessageBoxButtons.OK);
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
            finally
            {
                //this.Cursor = currentCursor;
            }
        }
Exemple #13
0
        private void ToolStripButton1_Click(object sender, EventArgs e)
        {
            ConsultInfoService service = new ConsultInfoService();

            try
            {
                DataRow[] insRows = dt.Select(null, null, DataViewRowState.Added);
                foreach (DataRow dr in insRows)
                {
                    ConsultInfoVO item = SetConsultInfoVo1(dr);
                    service.Insert(item, lblStudentID.Text);
                }
                DataRow[] upsRows = dt.Select(null, null, DataViewRowState.ModifiedCurrent);

                foreach (DataRow dr in upsRows)
                {
                    ConsultInfoVO item = SetConsultInfoVo(dr);
                    service.Update(item, lblStudentID.Text);
                }

                DataRow[] delRows = dt.Select(null, null, DataViewRowState.Deleted);

                foreach (DataRow dr in delRows)
                {
                    ConsultInfoVO item = SetDelConsultInfoVo(dr);
                    service.Delete(item, lblStudentID.Text);
                }

                MaterialMessageBox.Show("저장완료", "확인", MessageBoxButtons.OK);
            }
            catch (InvalidCastException)
            {
                MaterialMessageBox.Show("항목을 입력해주세요", "경고", MessageBoxButtons.OK);
            }
            catch (Exception err2)
            {
                MaterialMessageBox.Show(err2.Message, "경고", MessageBoxButtons.OK);
            }
            finally
            {
                service.Dispose();
            }
        }
Exemple #14
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, "경고");
            }
        }
Exemple #15
0
        private void BtnCreate_Click(object sender, EventArgs e)
        {
            StudentInfoInsUpForm frm = new StudentInfoInsUpForm(StudentInfoInsUpForm.EditMode.Input);

            try
            {
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    StudentInfoDAC stdDB = new StudentInfoDAC();
                    stdDB.Insert(frm.StudentInfo);
                    stdDB.Dispose();
                    MaterialMessageBox.Show("신규등록이 완료되었습니다.", "확인", MessageBoxButtons.OK);
                    LoadStudentGridData();
                    LoadStudentInfoData();
                    LoadStudentImage();
                    LoadStudentDetailInfoData();
                }
            }
            catch (Exception err)
            {
                MetroFramework.MetroMessageBox.Show(this, err.Message, "경고");
            }
        }
Exemple #16
0
        private void 삭제ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string msg = string.Format("{0} 학생을 삭제하시겠습니까?",
                                       StudentGrid[1, StudentGrid.CurrentRow.Index].Value.ToString());

            try
            {
                if (MaterialMessageBox.Show(msg, "삭제확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    string         stuID = StudentGrid[0, StudentGrid.CurrentRow.Index].Value.ToString();
                    StudentInfoDAC stdDB = new StudentInfoDAC();
                    stdDB.Delete(stuID);
                    stdDB.Dispose();
                    LoadStudentGridData();
                    LoadStudentInfoData();
                    LoadStudentImage();
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Exemple #17
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();
            }
        }