예제 #1
0
 private void cboHocky_SelectedValueChanged(object sender, EventArgs e)
 {
     try
     {
         _idhocky = cboHocky.SelectedValue.ToString();
         if (_idhocky == "0")
         {
             if (_idnamhoc == 0)
             {
                 if (_idlop != 0)
                 {
                     dgv_DanhSach.DataSource = SearchData.Timkiemtheolop1(_idlop);
                 }
                 else if (_idkhoa != 0)
                 {
                     dgv_DanhSach.DataSource = SearchData.Timkiemtheokhoa1(_idkhoa);
                 }
                 else
                 {
                     LoadGrid();
                 }
             }
             else if (_idlop != 0)
             {
                 dgv_DanhSach.DataSource = SearchData.Quanlydiem(1, _idkhoa, _idlop, _idnamhoc, _idhocky);
             }
             else if (_idkhoa != 0)
             {
                 dgv_DanhSach.DataSource = SearchData.Quanlydiem(2, _idkhoa, _idlop, _idnamhoc, _idhocky);
             }
             else
             {
                 dgv_DanhSach.DataSource = SearchData.Quanlydiem(3, _idkhoa, _idlop, _idnamhoc, _idhocky);
             }
         }
         else if (_idnamhoc != 0)
         {
             if (_idlop != 0)
             {
                 dgv_DanhSach.DataSource = SearchData.Quanlydiem(7, _idkhoa, _idlop, _idnamhoc, _idhocky);
             }
             else if (_idkhoa != 0)
             {
                 dgv_DanhSach.DataSource = SearchData.Quanlydiem(8, _idkhoa, _idlop, _idnamhoc, _idhocky);
             }
             else
             {
                 dgv_DanhSach.DataSource = SearchData.Quanlydiem(9, _idkhoa, _idlop, _idnamhoc, _idhocky);
             }
         }
         else if (_idlop != 0)
         {
             dgv_DanhSach.DataSource = SearchData.Quanlydiem(4, _idkhoa, _idlop, _idnamhoc, _idhocky);
         }
         else if (_idkhoa != 0)
         {
             dgv_DanhSach.DataSource = SearchData.Quanlydiem(5, _idkhoa, _idlop, _idnamhoc, _idhocky);
         }
         else
         {
             dgv_DanhSach.DataSource = SearchData.Quanlydiem(6, _idkhoa, _idlop, _idnamhoc, _idhocky);
         }
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }