Exemplo n.º 1
0
        //**************************************************************************
        ///    <Description>
        ///       When load the form, get all data from sys_Report table and fill to list
        ///    </Description>
        ///    <Inputs>
        ///
        ///    </Inputs>
        ///    <Outputs>
        ///
        ///    </Outputs>
        ///    <Returns>
        ///
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///       06-Jan-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************
        private void ReportList_Load(object sender, EventArgs e)
        {
            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.WaitCursor;

            #endregion Code Inserted Automatically


            const string METHOD_NAME = THIS + ".ReportList_Load()";
            try
            {
                ReportManagementBO boReportManagement = new ReportManagementBO();
                arrReports = boReportManagement.GetAllReports();
                if (arrReports.Count > 0)
                {
                    sys_ReportVO voReport;
                    for (int i = 0; i < arrReports.Count; i++)
                    {
                        voReport = (sys_ReportVO)arrReports[i];
                        // add to list
                        if (!voReport.ReportID.Equals(this.strMasterID))
                        {
                            if (this.strSearchBy.Equals(sys_ReportTable.REPORTID_FLD))
                            {
                                lstReportList.Items.Add(voReport.ReportID);
                            }
                            else
                            {
                                lstReportList.Items.Add(voReport.ReportName);
                            }
                        }
                    }
                    this.lstReportList.Focus();
                    this.lstReportList.Select();
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }

            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.Default;

            #endregion Code Inserted Automatically
        }
Exemplo n.º 2
0
        private void LastReport_Load(object sender, EventArgs e)
        {
            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.WaitCursor;

            #endregion Code Inserted Automatically


            const string METHOD_NAME = THIS + ".LastReport_Load()";
            const string SEPARATOR   = " - ";
            const string DATE_FORMAT = "dd-MM-yyyy hh:mm:ss";
            try
            {
                // get last 10 report executed by user
                ArrayList          arrObjects         = new ArrayList();
                LastReportBO       boLastReport       = new LastReportBO();
                ReportManagementBO boReportManagement = new ReportManagementBO();
                arrObjects = boLastReport.GetLast10Report(SystemProperty.UserName);

                // bind to list
                sys_ReportHistoryVO voReportHistory;
                string   strReportName = string.Empty;
                TreeNode tnNode;
                for (int i = 0; i < arrObjects.Count; i++)
                {
                    voReportHistory = (sys_ReportHistoryVO)arrObjects[i];
                    strReportName   = boReportManagement.GetReportName(voReportHistory.ReportID);
                    tnNode          = new TreeNode(Constants.OPEN_SBRACKET + voReportHistory.ExecDateTime.ToString(DATE_FORMAT) +
                                                   Constants.CLOSE_SBRACKET + SEPARATOR + strReportName);
                    tnNode.Tag = voReportHistory;
                    tvwReportList.Nodes.Add(tnNode);
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }

            // Code Inserted Automatically

            #region Code Inserted Automatically

            this.Cursor = Cursors.Default;

            #endregion Code Inserted Automatically
        }