Пример #1
0
        private void btnNhapketquakham_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            int    dong      = gridView1.FocusedRowHandle;
            string StudentID = gridView1.GetRowCellValue(dong, gridView1.Columns["StudentID"]).ToString();
            frmAddHealthExaminationDetail m_addHealthDetail = new frmAddHealthExaminationDetail();

            m_addHealthDetail.iFunction         = 1;
            m_addHealthDetail.healthExamination = new HealthExaminationDAO().GetByID(int.Parse(healthExamination.HealthExaminationID.ToString()));
            //  m_addHealthDetail.m_HealthExaminationDetail = new HealthExaminationDetailDAO().GetByID(int.Parse(healthExamination.HealthExaminationID.ToString()));
            m_addHealthDetail.Student = new StudentDAO().GetByID(int.Parse(StudentID.ToString()));
            m_addHealthDetail.ShowDialog();
            if (m_addHealthDetail.DialogResult == DialogResult.OK)
            {
                Danhsach(int.Parse(Class.ClassID.ToString()));
            }
        }
        //------------------Gridview_Button------------------
        private void btnchinhsua_Click(object sender, EventArgs e)
        {
            int    dong      = gridView1.FocusedRowHandle;
            string StudentID = gridView1.GetRowCellValue(dong, gridView1.Columns["StudentID"]).ToString();
            string DetailID  = gridView1.GetRowCellValue(dong, gridView1.Columns["HealthExaminationDetailID"]).ToString();
            frmAddHealthExaminationDetail m_addHealthDetail = new frmAddHealthExaminationDetail();

            m_addHealthDetail.iFunction                 = 2;
            m_addHealthDetail.healthExamination         = new HealthExaminationDAO().GetByID(int.Parse(cmbHealthExam.SelectedValue.ToString()));
            m_addHealthDetail.m_HealthExaminationDetail = new HealthExaminationDetailDAO().GetByID(int.Parse(DetailID.ToString()));
            m_addHealthDetail.Student = new StudentDAO().GetByID(int.Parse(StudentID.ToString()));
            m_addHealthDetail.ShowDialog();
            if (m_addHealthDetail.DialogResult == DialogResult.OK)
            {
                FillGridControl(int.Parse(cmbLopHoc.SelectedValue.ToString()), int.Parse(cmbHealthExam.SelectedValue.ToString()));
            }
        }