コード例 #1
0
        private void MMenuStreamlineSome_Click(object sender, EventArgs e)
        {
            MbrSelectFmMulti Fm = new MbrSelectFmMulti();

            Fm.MbrSelect = VC2WinFmApp.Engine.GetSqdMbrSelect();
            if (Fm.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            IList <BaseEntity> Eties = Fm.GetSelectEties();

            if (Eties == null || Eties.Count == 0)
            {
                return;
            }

            IList <EnSquad> Squads = new List <EnSquad>();

            foreach (BaseEntity ety in Eties)
            {
                Squads.Add(ety as EnSquad);
            }
            VC2WinFmApp.Engine.Optimization(Squads, false, false);

            foreach (EnSquad sqd in Squads)
            {
                this.OpenScheduleFm(sqd);
            }
        }
コード例 #2
0
        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();
        }