public TkbHocKyLopForm(MainForm main, Lop lop, XepTietHocForm frm) { this.apis = main.Apis; this.Lop = lop; this.frm = frm; HocKy = main.HocKy; main.enableIn(true); this.main = main; size = main.sizeHocKy; InitializeComponent(); }
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); } } }
private void btnXepTietHoc_ItemClick(object sender, ItemClickEventArgs e) { XepTietHocForm = new XepTietHocForm(this); XepTietHocForm.MdiParent = this; XepTietHocForm.Show(); }