private void MMenuPrintSet_Click(object sender, EventArgs e) { PageSetupDialog pd = new PageSetupDialog(); pd.Document = VcPrintDocument.GetInstance(); pd.ShowDialog(); }
private void MMenuPrint_Click(object sender, EventArgs e) { IList <BaseEntity> etis = new List <BaseEntity>(); BaseEntity entity = (this.ActiveMdiChild as IScheduleFm).Entity; VcPrintDocument.GetInstance().DocumentName = entity.ToString(); etis.Add(entity); VcPrintDocument.GetInstance().Entitis = etis; VcPrintDocument.GetInstance().Print(); }
private void PrintSome(Type type) { MbrSelectFmMulti Fm = new MbrSelectFmMulti(); if (type == typeof(EnSquad)) { Fm.MbrSelect = VC2WinFmApp.Engine.GetSqdMbrSelect(); } else if (type == typeof(EnTeacher)) { Fm.MbrSelect = VC2WinFmApp.Engine.GetTchMbrSelect(); } else { throw new Exception("未知的类型"); } if (Fm.ShowDialog() != DialogResult.OK) { return; } IList <BaseEntity> Eties = Fm.GetSelectEties(); if (Eties == null || Eties.Count == 0) { return; } VcPrintDocument Doc = VcPrintDocument.GetInstance(); PrintDialog pd = new PrintDialog(); pd.Document = Doc; if (pd.ShowDialog() != DialogResult.OK) { return; } if (type == typeof(EnTeacher)) { Doc.DocumentName = "教师课表"; } else if (type == typeof(EnSquad)) { Doc.DocumentName = "班级课表"; } else if (type == typeof(EnSubject)) { Doc.DocumentName = "课程课表"; } Doc.Entitis = Eties; Doc.Print(); }
private void MMenuPrintPreview_Click(object sender, EventArgs e) { IList <BaseEntity> etis = new List <BaseEntity>(); etis.Add((this.ActiveMdiChild as IScheduleFm).Entity); VcPrintDocument.GetInstance().Entitis = etis; PrintPreviewDialog dlg = new PrintPreviewDialog(); dlg.Document = VcPrintDocument.GetInstance(); dlg.ShowDialog(); }