示例#1
0
        void Load_Teacher(string magv)
        {
            DataTable dt = new DataTable();

            try
            {
                dt = teacherBUS.SearchTeacherIf(magv);

                txtNameTeacher.DataBindings.Clear();
                txtNameTeacher.DataBindings.Add("Text", dt, "TenGV", true, DataSourceUpdateMode.Never);
            }
            catch (Exception)
            {
            }
        }
示例#2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtSearch.Text != "")
                {
                    //values[0] : mã giáo viên
                    values[0] = (txtSearch.Text);
                    if (teacherBUS.ExistsOfTeacher(values[0]) == 0)
                    {
                        throw new Exception();
                    }

                    dtgvTeacher.DataSource = teacherBUS.SearchTeacherIf(values[0]);
                }
                else
                {
                    Load_Teacher();
                }
            }
            catch (Exception)
            {
            }
        }