Beispiel #1
0
        //**************************************************************************
        ///    <Description>
        ///      This method uses to get all report data of a group by user role
        ///    </Description>
        ///    <Inputs>
        ///		Group ID
        ///    </Inputs>
        ///    <Outputs>
        ///		DataSet
        ///    </Outputs>
        ///    <Returns>
        ///       DataSet
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///		Created: 29-Dec-2004
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public ArrayList GetAllReports(string pstrGroupID, string pstrUserName)
        {
            // get user id
            int          intUserID   = new Sys_UserDS().GetUserIDByUserName(pstrUserName);
            sys_ReportDS dsSysReport = new sys_ReportDS();

            return(dsSysReport.GetAllReports(pstrGroupID, intUserID));
        }
Beispiel #2
0
        //**************************************************************************
        ///    <Description>
        ///      This method uses to get all report data of a group by user role
        ///    </Description>
        ///    <Inputs>
        ///		Group ID
        ///    </Inputs>
        ///    <Outputs>
        ///		DataSet
        ///    </Outputs>
        ///    <Returns>
        ///       DataSet
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///		Created: 29-Dec-2004
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public DataSet ListByUser(string pstrGroupID, string pstrUserName)
        {
            // get user id
            int          intUserID   = new Sys_UserDS().GetUserIDByUserName(pstrUserName);
            sys_ReportDS dsSysReport = new sys_ReportDS();

            return(dsSysReport.ListByUser(pstrGroupID, intUserID));
        }
Beispiel #3
0
        public DataSet ExecuteReportCommand(string pstrReportCommand, string pstrTableName)
        {
            DataSet      dstResult = new DataSet();
            sys_ReportDS dsReport  = new sys_ReportDS();

            dstResult = dsReport.ExecuteReportCommand(pstrReportCommand, pstrTableName);
            return(dstResult);
        }
Beispiel #4
0
        //**************************************************************************
        ///    <Description>
        ///       This method not implements yet
        ///    </Description>
        ///    <Inputs>
        ///
        ///    </Inputs>
        ///    <Outputs>
        ///
        ///    </Outputs>
        ///    <Returns>
        ///
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///		Created: 28-Dec-2004
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public void Delete(object pObjectVO)
        {
            sys_ReportVO voReport = (sys_ReportVO)pObjectVO;

            sys_ReportAndGroupDS dsReportAndGroup = new sys_ReportAndGroupDS();

            // delete data in sys_ReportAndGroup
            dsReportAndGroup.DeleteByReportID(voReport.ReportID);

            // delete data in sys_ReportDrillDown where master id is selected report id
            sys_ReportDrillDownDS dsDrillDown = new sys_ReportDrillDownDS();

            dsDrillDown.Delete(voReport.ReportID);

            // delete data in sys_ReportFields
            sys_ReportFieldsDS dsReportFields = new sys_ReportFieldsDS();

            dsReportFields.Delete(voReport.ReportID);

            // delete data in sys_ReportPara
            sys_ReportParaDS dsReportPara = new sys_ReportParaDS();

            dsReportPara.Delete(voReport.ReportID);

            // retrieve history of this report
            sys_ReportHistoryVO     voReportHistory = new sys_ReportHistoryVO();
            sys_ReportHistoryDS     dsReportHistory = new sys_ReportHistoryDS();
            sys_ReportHistoryParaDS dsHistoryPara   = new sys_ReportHistoryParaDS();
            ArrayList arrHistory = new ArrayList();

            arrHistory = dsReportHistory.ListByReport(voReport.ReportID);
            // delete all data in sys_ReportHistoryPara related to each history
            if (arrHistory.Count > 0)
            {
                for (int i = 0; i < arrHistory.Count - 1; i++)
                {
                    voReportHistory = (sys_ReportHistoryVO)arrHistory[i];
                    dsHistoryPara.Delete(voReportHistory.HistoryID);
                }
            }
            // delete data in sys_ReportHistory
            dsReportHistory.DeleteByReportID(voReport.ReportID);

            // delete data in sys_Report
            sys_ReportDS dsReport = new sys_ReportDS();

            dsReport.Delete(voReport.ReportID);
        }
Beispiel #5
0
        //**************************************************************************
        ///    <Description>
        ///       This method checks business rule and call Add() method of DS class
        ///    </Description>
        ///    <Inputs>
        ///       Value object
        ///    </Inputs>
        ///    <Outputs>
        ///      N/A
        ///    </Outputs>
        ///    <Returns>
        ///      void
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///     3-Jan-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public void Add(object pobjObjectVO)
        {
            sys_ReportDS dsReport = new sys_ReportDS();

            dsReport.Add(pobjObjectVO);
        }
Beispiel #6
0
        //**************************************************************************
        ///    <Description>
        ///       This method uses to update a DataSet
        ///    </Description>
        ///    <Inputs>
        ///        DataSet
        ///    </Inputs>
        ///    <Outputs>
        ///      N/A
        ///    </Outputs>
        ///    <Returns>
        ///       void
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///       3-Jan-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public void UpdateDataSet(DataSet pData)
        {
            sys_ReportDS dsReport = new sys_ReportDS();

            dsReport.UpdateDataSet(pData);
        }
Beispiel #7
0
        //**************************************************************************
        ///    <Description>
        ///      This method uses to get all data
        ///    </Description>
        ///    <Inputs>
        ///
        ///    </Inputs>
        ///    <Outputs>
        ///
        ///    </Outputs>
        ///    <Returns>
        ///       DataSet
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///       3-Jan-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public DataSet List()
        {
            sys_ReportDS dsReport = new sys_ReportDS();

            return(dsReport.List());
        }
Beispiel #8
0
        //**************************************************************************
        ///    <Description>
        ///       This method uses to update data
        ///    </Description>
        ///    <Inputs>
        ///       pobjObjecVO
        ///    </Inputs>
        ///    <Outputs>
        ///
        ///    </Outputs>
        ///    <Returns>
        ///       void
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    3-Jan-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public void Update(object pobjObjecVO)
        {
            sys_ReportDS dsReport = new sys_ReportDS();

            dsReport.Update(pobjObjecVO);
        }
Beispiel #9
0
        //**************************************************************************
        ///    <Description>
        ///       This method uses to get data
        ///    </Description>
        ///    <Inputs>
        ///       pintID
        ///    </Inputs>
        ///    <Outputs>
        ///      Value object
        ///    </Outputs>
        ///    <Returns>
        ///       object
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///     3-Jan-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public object GetObjectVO(string pstrID)
        {
            sys_ReportDS dsReport = new sys_ReportDS();

            return(dsReport.GetObjectVO(pstrID));
        }
Beispiel #10
0
        //**************************************************************************
        ///    <Description>
        ///       This method checks business rule and call Delete() method of DS class
        ///    </Description>
        ///    <Inputs>
        ///        pintID
        ///    </Inputs>
        ///    <Outputs>
        ///     Delete a record  from Database
        ///    </Outputs>
        ///    <Returns>
        ///       void
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///    3-Jan-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public void Delete(string pstrID)
        {
            sys_ReportDS dsReport = new sys_ReportDS();

            dsReport.Delete(pstrID);
        }
Beispiel #11
0
        //**************************************************************************
        ///    <Description>
        ///       This method uses to get the ReportName of ReportID in sys_Report
        ///    </Description>
        ///    <Inputs>
        ///        ReportID
        ///    </Inputs>
        ///    <Outputs>
        ///        ReportName
        ///    </Outputs>
        ///    <Returns>
        ///       string
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///       20-Jan-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public string GetReportName(string pstrReportID)
        {
            sys_ReportDS dsReport = new sys_ReportDS();

            return(dsReport.GetReportName(pstrReportID));
        }
Beispiel #12
0
        /// <summary>
        /// Get all report in a group
        /// </summary>
        /// <param name="pstrGroupID">Group ID</param>
        /// <returns>List of Report in a group</returns>

        public ArrayList GetAllReports(string pstrGroupID)
        {
            sys_ReportDS dsSysReport = new sys_ReportDS();

            return(dsSysReport.GetAllReports(pstrGroupID));
        }
Beispiel #13
0
        //**************************************************************************
        ///    <Description>
        ///      This method uses to get all report
        ///    </Description>
        ///    <Inputs>
        ///
        ///    </Inputs>
        ///    <Outputs>
        ///		ArrayList
        ///    </Outputs>
        ///    <Returns>
        ///       ArrayList
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///		06-Jan-2005
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public ArrayList GetAllReports()
        {
            sys_ReportDS dsSysReport = new sys_ReportDS();

            return(dsSysReport.GetAllReports());
        }
Beispiel #14
0
        //**************************************************************************
        ///    <Description>
        ///       This method uses to make a copy of specified report to another group,
        ///       also copy all data relative to report (sys_ReportAndGroup, sys_ReportDrillDown,
        ///       sys_ReportFields, sys_ReportPara).
        ///    </Description>
        ///    <Inputs>
        ///        Source ReportID, Destination GroupID
        ///    </Inputs>
        ///    <Outputs>
        ///      New report id
        ///    </Outputs>
        ///    <Returns>
        ///       new report id
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///       03-Jan-2005
        ///       11-Jan-2005
        ///    </History>
        ///    <Notes>
        ///		Return newly report id
        ///    </Notes>
        //**************************************************************************

        public object CopyReport(string pstrReportID, string pstrGroupID, out int ointReportOrder)
        {
            const string METHOD_NAME          = THIS + ".CopyReport()";
            const int    REPORT_ID_MAX_LENGTH = 20;
            const string CODE_DATE_FORMAT     = "yyyyMMddHHmmssfff";
            UtilsBO      boUtils  = new UtilsBO();
            sys_ReportDS dsReport = new sys_ReportDS();
            sys_ReportVO voReport;

            // use to add new report to selected group
            sys_ReportAndGroupVO voReportAndGroup = new sys_ReportAndGroupVO();
            sys_ReportAndGroupDS dsReportAndGroup = new sys_ReportAndGroupDS();

            // use to copy report para
            sys_ReportParaDS dsReportPara = new sys_ReportParaDS();

            // use to copy report fields
            sys_ReportFieldsDS dsReportFields = new sys_ReportFieldsDS();

            // use to copy drill down report
            sys_ReportDrillDownDS dsReportDrillDown = new sys_ReportDrillDownDS();

            // get the data of selected object
            voReport = (sys_ReportVO)(dsReport.GetObjectVO(pstrReportID));

            #region Copy report
            // make a copy report
            sys_ReportVO voCopiedReport = new sys_ReportVO();
            voCopiedReport = voReport;
            // get database server date time
            DateTime dtmDB = boUtils.GetDBDate();
            // report ID = yyyyMMddHHmmssfff
            voCopiedReport.ReportID = dtmDB.ToString(CODE_DATE_FORMAT);
            if (voCopiedReport.ReportID.Length > REPORT_ID_MAX_LENGTH)
            {
                throw new PCSBOException(ErrorCode.MESSAGE_VALUE_TOO_LONG, METHOD_NAME, new Exception());
            }
            voCopiedReport.ReportName = Constants.COPY_OF + voCopiedReport.ReportName;
            // save new report to database
            dsReport.Add(voCopiedReport);
            #endregion

            #region Add new report to group
            voReportAndGroup.GroupID  = pstrGroupID;
            voReportAndGroup.ReportID = voCopiedReport.ReportID;
            // increase report order by one in group.
            voReportAndGroup.ReportOrder = dsReportAndGroup.GetMaxReportOrder(pstrGroupID) + 1;
            // save data
            dsReportAndGroup.Add(voReportAndGroup);
            ointReportOrder = voReportAndGroup.ReportOrder;
            #endregion

            #region Copy all data relative from old report to new report

            #region ReportPara
            // get all parameter(s)
            sys_ReportParaVO voReportPara;
            ArrayList        arrParas = dsReportPara.GetObjectVOs(pstrReportID);
            // make a copy of each parameter
            if (arrParas.Count > 0)
            {
                for (int i = 0; i < arrParas.Count; i++)
                {
                    voReportPara = (sys_ReportParaVO)(arrParas[i]);
                    // assign new report id
                    voReportPara.ReportID = voCopiedReport.ReportID;
                    // save new para
                    dsReportPara.Add(voReportPara);
                }
            }
            #endregion

            #region ReportFields
            // get all report fields
            sys_ReportFieldsVO voReportFields;
            ArrayList          arrFields = dsReportFields.GetObjectVOs(pstrReportID);
            // make a copy of each field
            if (arrFields.Count > 0)
            {
                for (int i = 0; i < arrFields.Count; i++)
                {
                    voReportFields = (sys_ReportFieldsVO)arrFields[i];
                    // assign new report id
                    voReportFields.ReportID = voCopiedReport.ReportID;
                    // save new field
                    dsReportFields.Add(voReportFields);
                }
            }
            #endregion

            #region ReportDrillDown
            // get all drill down report
            sys_ReportDrillDownVO voReportDrillDown;
            ArrayList             arrDrillDown = dsReportDrillDown.GetObjectVOs(pstrReportID);
            // make a copy each drill down report
            if (arrDrillDown.Count > 0)
            {
                for (int i = 0; i < arrDrillDown.Count; i++)
                {
                    voReportDrillDown = (sys_ReportDrillDownVO)arrDrillDown[i];
                    // assign new report id
                    voReportDrillDown.MasterReportID = voCopiedReport.ReportID;
                    // save new drill down
                    dsReportDrillDown.Add(voReportDrillDown);
                }
            }
            #endregion

            #endregion

            return(voCopiedReport);
        }
Beispiel #15
0
        //**************************************************************************
        ///    <Description>
        ///      This method uses to get all report data of a group
        ///    </Description>
        ///    <Inputs>
        ///		Group ID
        ///    </Inputs>
        ///    <Outputs>
        ///		DataSet
        ///    </Outputs>
        ///    <Returns>
        ///       DataSet
        ///    </Returns>
        ///    <Authors>
        ///       DungLA
        ///    </Authors>
        ///    <History>
        ///		Created: 29-Dec-2004
        ///    </History>
        ///    <Notes>
        ///    </Notes>
        //**************************************************************************

        public DataSet List(string pstrGroupID)
        {
            sys_ReportDS dsSysReport = new sys_ReportDS();

            return(dsSysReport.List(pstrGroupID));
        }