protected void Page_Load(object sender, EventArgs e) { if (Session["Admin"] == null) { return; } Admin a = (Admin)Session["Admin"]; LabelUserName.Text = a.MaGv1; if (!IsPostBack) { DropDownListClass.DataTextField = "TenLop"; DropDownListClass.DataValueField = "MaLop"; DropDownListClass.DataSource = Lop.getAllClass(); DropDownListClass.DataBind(); GridViewSinhVien.DataSource = SinhVien.getAllSinhVien(); GridViewSinhVien.DataBind(); DropDownListKhoa.DataTextField = "TenKhoa1"; DropDownListKhoa.DataValueField = "MaKhoa1"; DropDownListKhoa.DataSource = Khoa.GetKhoas(); DropDownListKhoa.DataBind(); } }
private void LopHocForm_Load(object sender, EventArgs e) { dataGridViewLop.DataSource = Lop.getAllClass(); comboBoxKhoa.DisplayMember = "TenKhoa1"; comboBoxKhoa.ValueMember = "MaKhoa1"; comboBoxKhoa.DataSource = Khoa.GetKhoas(); comboBoxMaGV.DisplayMember = "TenGv1"; comboBoxMaGV.ValueMember = "MaGv1"; comboBoxMaGV.DataSource = GiangVien.GetGiangViens(); }
private void AddGiangVien_Load(object sender, EventArgs e) { comboBoxMaKhoa.ValueMember = "MaKhoa1"; comboBoxMaKhoa.DisplayMember = "TenKhoa1"; comboBoxMaKhoa.DataSource = Khoa.GetKhoas(); }
private void Khoa_Load(object sender, EventArgs e) { dataGridViewKhoa.DataSource = Khoa.GetKhoas(); }