Exemplo n.º 1
0
        void load()
        {
            try
            {
                dsidgv = lopbll.IDGV(ref error, tentaikhoan);
                int idgv = Convert.ToInt32(dsidgv.Tables[0].Rows[0]["IDGV"].ToString());

                try
                {
                    dslop = lopbll.DSLopTheoGV(ref error, idgv);
                    if (dslop.Tables[0].Rows.Count > 0)
                    {
                        cbxLop.DataSource    = dslop.Tables[0];
                        cbxLop.DisplayMember = "TenLop";
                        cbxLop.ValueMember   = "IDLop";
                        cbxLop.SelectedIndex = 0;
                        hienthidata();
                    }
                    else
                    {
                        MessageBox.Show("Hiện tại bạn chưa có lớp", "Thông báo", MessageBoxButtons.OK,
                                        MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            }
            catch (Exception)
            {
                DialogResult tl = MessageBox.Show("Lỗi load", "Lỗi", MessageBoxButtons.OK,
                                                  MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }