Esempio n. 1
0
        private void QueryReportInfo(OVRReportInfoQueryArgs oArgs)
        {
            if (oArgs == null || m_frmReportPrinting == null)
            {
                return;
            }

            oArgs.Handled = m_frmReportPrinting.QueryReportInfo(oArgs.ReportInfo);
        }
        private void GetReportInfo()
        {
            string strTemplateName;

            strTemplateName = ConfigurationManager.GetUserSettingString("TplCommunication");
            m_oReportInfoOfc.TemplateName = strTemplateName;

            strTemplateName = ConfigurationManager.GetUserSettingString("TplOnDuty");
            m_oReportInfoOnDuty.TemplateName = strTemplateName;

            strTemplateName = ConfigurationManager.GetUserSettingString("TplOffDuty");
            m_oReportInfoOffDuty.TemplateName = strTemplateName;

            // Query Official Communication Report Info
            OVRReportInfoQueryArgs oArgs = new OVRReportInfoQueryArgs();

            oArgs.Handled    = false;
            oArgs.ReportInfo = m_oReportInfoOfc;
            NotifyMainFrame(OVRModule2FrameEventType.emReportInfoQuery, oArgs);

            // Query Official OnDuty Report Info
            oArgs.Handled    = false;
            oArgs.ReportInfo = m_oReportInfoOnDuty;
            NotifyMainFrame(OVRModule2FrameEventType.emReportInfoQuery, oArgs);

            // Query Official OffDuty Report Info
            oArgs.Handled    = false;
            oArgs.ReportInfo = m_oReportInfoOffDuty;
            NotifyMainFrame(OVRModule2FrameEventType.emReportInfoQuery, oArgs);

            // Update Communication Report User Interface
            chbCorrected.Checked = m_oReportInfoOfc.IsCorrected;
            chbTest.Checked      = m_oReportInfoOfc.IsTest;
            tbRscCode.Text       = m_oReportInfoOfc.RSC;
            tbRptType.Text       = m_oReportInfoOfc.TemplateType;
            tbVersion.Text       = m_oReportInfoOfc.TemplateVersion;
            tbDisVersion.Text    = QueryDistrubutedVersion(m_oReportInfoOfc.TemplateType, m_oReportInfoOfc.RSC);

            // Update dgvReportForDuty
            DataGridViewColumn col = new DataGridViewTextBoxColumn();

            col.Name       = "Report";
            col.HeaderText = "Report";
            col.ReadOnly   = true;
            dgvReportForDuty.Columns.Add(col);
            col            = new DataGridViewTextBoxColumn();
            col.Name       = "Type";
            col.HeaderText = "Type";
            col.ReadOnly   = true;
            dgvReportForDuty.Columns.Add(col);
            col            = new DataGridViewTextBoxColumn();
            col.Name       = "Version";
            col.HeaderText = "Version";
            col.ReadOnly   = false;
            dgvReportForDuty.Columns.Add(col);
            col            = new DataGridViewTextBoxColumn();
            col.Name       = "Distrubuted Version";
            col.HeaderText = "Distrubuted Version";
            col.ReadOnly   = true;
            dgvReportForDuty.Columns.Add(col);
            col            = new DataGridViewTextBoxColumn();
            col.Name       = "RSC";
            col.HeaderText = "RSC";
            col.ReadOnly   = true;
            dgvReportForDuty.Columns.Add(col);

            DataGridViewRow dr = new DataGridViewRow();

            dr.CreateCells(dgvReportForDuty);
            dr.Selected       = false;
            dr.Cells[0].Value = m_oReportInfoOnDuty.TemplateName;
            dr.Cells[1].Value = m_oReportInfoOnDuty.TemplateType;
            dr.Cells[2].Value = m_oReportInfoOnDuty.TemplateVersion;
            dr.Cells[3].Value = QueryDistrubutedVersion(m_oReportInfoOnDuty.TemplateType, m_oReportInfoOnDuty.RSC);
            dr.Cells[4].Value = m_oReportInfoOnDuty.RSC;
            dgvReportForDuty.Rows.Add(dr);

            dr = new DataGridViewRow();
            dr.CreateCells(dgvReportForDuty);
            dr.Selected       = false;
            dr.Cells[0].Value = m_oReportInfoOffDuty.TemplateName;
            dr.Cells[1].Value = m_oReportInfoOffDuty.TemplateType;
            dr.Cells[2].Value = m_oReportInfoOffDuty.TemplateVersion;
            dr.Cells[3].Value = QueryDistrubutedVersion(m_oReportInfoOffDuty.TemplateType, m_oReportInfoOffDuty.RSC);
            dr.Cells[4].Value = m_oReportInfoOffDuty.RSC;
            dgvReportForDuty.Rows.Add(dr);
        }