Example #1
0
        private void runReport()
        {
            //DateTime localDate = new DateTime();
            //XmlDocument ReportADX;
            //ReportADX=xld.ToString();
            string  connectionString = Entity.GetConnString();
            Entity  en  = new Entity();
            DataRow fDr = null;

            {
                fDr = (DataRow)en.ReturnObject(connectionString, ClsUtility.theParams
                                               , "SELECT TOP 1 ConnString, DBase,MFLCode,DHISPortal FROM aa_Database"
                                               , ClsUtility.ObjectEnum.DataRow, "mssql");
                DHIS2URL = fDr[3].ToString();
                MFLCode  = fDr[2].ToString();
            }

            SetControlPropertyThreadSafe(fMain.picProgress, "Image", Properties.Resources.progressWheel5);
            SetControlPropertyThreadSafe(fMain.lblNotify, "Text", "Generating Report....");
            SetControlPropertyThreadSafe(this.btnGenerateReport, "Enabled", false);
            try
            {
                Hashtable      rh = setParameters();
                ReportsManager RM = new ReportsManager();
                RM.runReport(rh, satellites, bySatellite, linelists, SendtoDHIS2);

                if (SendtoDHIS2 == true)
                {
                    //adx.Checked = false;
                    //frmDHISPassword DHIS2PW = new frmDHISPassword();
                    //DialogResult dr = DHIS2PW.ShowDialog();

                    SendtoIL();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Assets.Messages.ErrorHeader);
            }
            finally
            {
                SetControlPropertyThreadSafe(fMain.picProgress, "Image", null);
                SetControlPropertyThreadSafe(fMain.lblNotify, "Text", "");
                SetControlPropertyThreadSafe(this.btnGenerateReport, "Enabled", true);
                //dhis.Checked = false;
                saveReportLog(MFLCode.ToString(), dh.dtpFromDate.Value, DHISReport, xld, DateTime.Now.Date);
            }
        }
Example #2
0
 private void runReport()
 {
     SetControlPropertyThreadSafe(fMain.picProgress, "Image", Properties.Resources.progressWheel5);
     SetControlPropertyThreadSafe(fMain.lblNotify, "Text", "Generating Report....");
     SetControlPropertyThreadSafe(this.btnGenerateReport, "Enabled", false);
     try
     {
         Hashtable      rh = setParameters();
         ReportsManager RM = new ReportsManager();
         RM.runReport(rh, satellites, bySatellite, linelists);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, Assets.Messages.ErrorHeader);
     }
     finally
     {
         SetControlPropertyThreadSafe(fMain.picProgress, "Image", null);
         SetControlPropertyThreadSafe(fMain.lblNotify, "Text", "");
         SetControlPropertyThreadSafe(this.btnGenerateReport, "Enabled", true);
     }
 }