private void btnTraCuuTheoLop_ItemClick(object sender, ItemClickEventArgs e) { TraCuuTheoLopForm frm = new TraCuuTheoLopForm(this, Ngay); frm.MdiParent = this; frm.Show(); }
private void dateNgay_EditValueChanged(object sender, EventArgs e) { Ngay = (DateTime)dateNgay.EditValue; if (HocKy == null) { return; } int check = Ngay.CompareTo(HocKy.ngayBatDau); if (Ngay.CompareTo(HocKy.ngayBatDau) <= 0 || Ngay.CompareTo(HocKy.ngayKetThuc) >= 0) { Ngay = DateTime.Now; dateNgay.EditValue = Ngay; return; } if (this.ActiveMdiChild == null) { return; } string fname = this.ActiveMdiChild.Name; if (fname == "TraCuuTheoLopForm") { TraCuuTheoLopForm frm = (TraCuuTheoLopForm)this.ActiveMdiChild; frm.SetDate(Ngay); } foreach (Form frm in this.MdiChildren) { if (frm.Name == "TraCuuTheoLopForm") { TraCuuTheoLopForm f = (TraCuuTheoLopForm)frm; f.SetDate(Ngay); } else if (frm.Name == "XepTietHocForm") { XepTietHocForm f = (XepTietHocForm)frm; f.SetDate(Ngay); } } }