private void btnXuatExcel_ItemClick(object sender, ItemClickEventArgs e) { if (this.ActiveMdiChild == null) { ribbonIn.Enabled = false; return; } if (this.ActiveMdiChild.Name == "TkbNgayLopForm") { TkbNgayLopForm frm = (TkbNgayLopForm)this.ActiveMdiChild; frm.save(); } else if (this.ActiveMdiChild.Name == "TkbHocKyLopForm") { TkbHocKyLopForm frm = (TkbHocKyLopForm)this.ActiveMdiChild; frm.save(); } else if (this.ActiveMdiChild.Name == "TkbTuanTruongForm") { TkbTuanTruongForm frm = (TkbTuanTruongForm)this.ActiveMdiChild; frm.save(); } else if (this.ActiveMdiChild.Name == "TkbHocKyTieuDoanForm") { TkbHocKyTieuDoanForm frm = (TkbHocKyTieuDoanForm)this.ActiveMdiChild; frm.save(); } else if (this.ActiveMdiChild.Name == "TkbNgayTatCaLopForm") { TkbNgayTatCaLopForm frm = (TkbNgayTatCaLopForm)this.ActiveMdiChild; frm.save(); } }
private async void btnXemTkbLop_ItemClick(object sender, ItemClickEventArgs e) { string choosed = cbxXemTheo.EditValue.ToString(); string str = txtTkbHocKy.EditValue == null ? "" : txtTkbHocKy.EditValue.ToString(); if (choosed == "Lớp") { Lop lop = await apis.GetLop(HocKy, str); if (lop != null) { TkbHocKyLopForm tKB_HK = new TkbHocKyLopForm(this, lop); tKB_HK.tietHocs = await apis.GetTietHocs(HocKy, lop, ""); tKB_HK.MdiParent = this; tKB_HK.Show(); } else { DialogResult dal = MessageBox.Show("Lớp không tồn tại", "Lỗi", MessageBoxButtons.OK); } } else { TieuDoan td = await apis.GetTieuDoan(str); if (td != null) { TkbHocKyTieuDoanForm frm = new TkbHocKyTieuDoanForm(this, str); frm.lops = await apis.GetLopsByTieuDoan(HocKy, str); frm.MdiParent = this; frm.Show(); } else { DialogResult dal = MessageBox.Show("Tiểu đoàn không tồn tại", "Lỗi", MessageBoxButtons.OK); } } }