示例#1
0
        public void launch_EAD_generator(IDbConnection connection, long IDNivel_PAI, long IDNivel, string FileName, Control TopLevelControl)
        {
            string mFileName = FileNameSelection(FileName);

            if (mFileName != null && !mFileName.Equals(""))
            {
                long ceiling = (long)(EADGeneratorRule.Current.get_Count_All_NiveisDescendentes(IDNivel, SessionHelper.GetGisaPrincipal().TrusteeUserOperator.ID, connection) / 2);

                progressBar             = new DoubleProgressBar();
                progressBar.Dock        = DockStyle.Fill;
                progressBar.ShowCurrent = false;
                progressBar.Current     = 0;
                progressBar.Maximum     = 0;
                progressBar.Ceiling     = (ceiling > 0 ? ceiling : 1);

                progressDialog                 = new Form();
                progressDialog.Size            = new Size(320, 82);
                progressDialog.FormBorderStyle = FormBorderStyle.FixedDialog;
                progressDialog.ControlBox      = false;
                progressDialog.ShowInTaskbar   = false;
                progressDialog.Text            = "Geração de EAD:" + mFileName + "...";
                progressDialog.StartPosition   = FormStartPosition.CenterParent;
                progressDialog.Controls.Add(progressBar);
                progressDialog.DockPadding.All = 16;

                this.IDNivel_PAI      = IDNivel_PAI;
                this.IDNivel          = IDNivel;
                this.the_EADGenerator = new EADGenerator(mFileName, connection);

                Thread th = new Thread(new System.Threading.ThreadStart(this.EAD_Runner));
                th.Start();
                progressDialog.ShowDialog(TopLevelControl);
            }
        }
示例#2
0
 [Test] public void validate_generated_ead()
 {
     GisaDataSetHelper.HoldOpen ho = new GisaDataSetHelper.HoldOpen(GisaDataSetHelper.GetConnection());
     try {
         string       fileName    = "GISA_EAD_Test.xml";
         EADGenerator gen_to_test = new EADGenerator(fileName, ho.Connection);
         long         IDNivel_PAI = 214;
         long         idNivel     = 215;
         gen_to_test.generate(IDNivel_PAI, idNivel);
         validate(fileName);
         Assert.IsTrue(isValid);
     }
     finally {
         ho.Dispose();
     }
 }
示例#3
0
        public static void Main()
        {
            GisaDataSetHelper.HoldOpen ho = new GisaDataSetHelper.HoldOpen(GisaDataSetHelper.GetConnection());
            try {
                string       fileName    = "GISA_EAD_Test.xml";
                EADGenerator gen_to_test = new EADGenerator(fileName, ho.Connection);
                //long idNivel = 100317;
                //long idNivel = 1865;
                //long idNivel = 23;

                // GISA_CS7_FEUP:
                //long idNivel = 14;    // Pautas ...
                //long idNivel = 212;     // Secretaria
                //long idNivel = 178;     // Conselho directivo
                //long IDNivel_PAI = 214;
                //long idNivel = 215;     // Direcao de servicos academicos...
                long IDNivel_PAI = 220;     // FEUP
                long idNivel     = 222;
                //long IDNivel_PAI = 19;     // FEUP
                //long idNivel = 52416;
                //long idNivel = 219;     // Seccao de pessoal
                //long idNivel = 168;     // (Serie) Comissao cooordenadora...

                //long idNivel = 102027;      // Para imagens:

                // GISA_CS6_CMGaia: 48326; 50600
                //long idNivel = 50066;   // Secretaria
                //long idNivel = 50570;   // Orlando Miranda
                //long idNivel = 46139;       // Presidência. 2002-2008

                gen_to_test.generate(IDNivel_PAI, idNivel);
                validate(fileName);
            }
            finally {
                ho.Dispose();
            }
        }