private void createReport(Object theReportSettings)
        {
            string _act = "";

            if (reportSettings.Activity == "Stoping")
            {
                _act = "0";
            }

            else if (reportSettings.Activity == "Development")
            {
                _act = "1";
            }
            MWDataManager.clsDataAccess _plathondWallRoomReportData = new MWDataManager.clsDataAccess();

            _plathondWallRoomReportData.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, UserCurrentInfo.Connection);
            _plathondWallRoomReportData.SqlStatement       = "sp_PlathondWallRoom";
            _plathondWallRoomReportData.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            _plathondWallRoomReportData.ResultsTableName   = "PlathondWallRoomData";

            SqlParameter[] _DevparamCollection =
            {
                _plathondWallRoomReportData.CreateParameter("@Prodmonth", SqlDbType.VarChar,  6, THarmonyPASGlobal.ProdMonthAsString(reportSettings.Prodmonth)),
                _plathondWallRoomReportData.CreateParameter("@Section",   SqlDbType.VarChar, 50, reportSettings.NAME),
                _plathondWallRoomReportData.CreateParameter("@Activity",  SqlDbType.VarChar,  1, _act),
            };

            _plathondWallRoomReportData.ParamCollection = _DevparamCollection;
            _plathondWallRoomReportData.queryReturnType = MWDataManager.ReturnType.DataTable;
            clsDataResult result = _plathondWallRoomReportData.ExecuteInstruction();

            if (!result.success)
            {
                throw new ApplicationException("Report Section:MODailyStopeData:" + result.Message);
            }

            DataSet repDataSet = new DataSet();


            repDataSet.Tables.Add(_plathondWallRoomReportData.ResultsDataTable);
            theReport.RegisterData(repDataSet);

            theReport.Load(TGlobalItems.ReportsFolder + "\\PlathondWallRoom.frx");

            theReport.SetParameterValue("Banner", THarmonyPASGlobal.getSystemSettingsProductioInfo(UserCurrentInfo.Connection).Mine);
            theReport.SetParameterValue("Prodmonth", THarmonyPASGlobal.ProdMonthAsString(reportSettings.Prodmonth));
            theReport.SetParameterValue("SectionName", reportSettings.NAME);
            theReport.SetParameterValue("TheDate", reportSettings.Activity);
            theReport.SetParameterValue("logo", TGlobalItems.ClientLogo);
            theReport.SetParameterValue("logoMineware", TGlobalItems.CompanyLogo);

            if (TParameters.DesignReport)
            {
                theReport.Design();
            }

            theReport.Prepare();
            ActiveReport.SetReport = theReport;
            ActiveReport.isDone    = true;
        }
        public DataTable get_ExistReports(string theUserID, string theExistReportName)
        {
            theData.ConnectionString = connectionString;
            theData.SqlStatement     = " select \r\n ";
            if (theExistReportName != "")
            {
                theData.SqlStatement = theData.SqlStatement + " * \r\n ";
            }
            else
            {
                theData.SqlStatement = theData.SqlStatement + " ReportName \r\n ";
            }
            theData.SqlStatement = theData.SqlStatement + " from GenericReport_Options where " +
                                   " UserID = '" + theUserID + "' \r\n ";
            if (theExistReportName != "")
            {
                theData.SqlStatement = theData.SqlStatement +
                                       " and ReportName = '" + theExistReportName + "' \r\n ";
            }
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", DBTag, "clsBookingsABS", "get_ExistReports", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
        public DataTable get_SICData(string _typemonth, string _prdmth, string _sectionid, string _hierid, string _kpi)
        {
            theData.SqlStatement       = "[sp_SICCapture_Load]";
            theData.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            theData.ResultsTableName   = "Kriging";

            SqlParameter[] _paramCollection =
            {
                theData.CreateParameter("@TypeMonth",    SqlDbType.VarChar, 20, _typemonth),
                theData.CreateParameter("@ProdMonth",    SqlDbType.VarChar,  6, _prdmth),
                theData.CreateParameter("@SectionID",    SqlDbType.VarChar, 20, _sectionid),
                theData.CreateParameter("@SectionLevel", SqlDbType.VarChar,  1, _hierid),
                theData.CreateParameter("@KPI",          SqlDbType.VarChar, 50, _kpi),
            };

            theData.ParamCollection = _paramCollection;
            theData.queryReturnType = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSICCapture", "get_SICData", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
        public bool save_BusPlanLocks(string _year, string _activity, string _startmonth, string _endmonth)
        {
            theData.SqlStatement =
                " delete from BusinessPlan_Locks \r\n " +
                " where Year = '" + _year + "' \r\n " +
                " and Activity = '" + _activity + "' \r\n " +
                " INSERT INTO BusinessPlan_Locks \r\n " +
                "           ([Year] \r\n " +
                "           ,[ProdMonthStart] \r\n " +
                "           ,[ProdMonthEnd] \r\n " +
                "           ,[IsLocked] \r\n " +
                "           ,[Activity]) \r\n " +
                "     VALUES \r\n " +
                "           ('" + _year + "' \r\n " +
                "           ,'" + _startmonth + "' \r\n " +
                "           ,'" + _endmonth + "'\r\n " +
                "           ,'false' \r\n " +
                "           ,'" + _activity + "') ";
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.longNumber;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsBusinessPlanImport", "save_BusPlanLocks", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(false);
            }
            else
            {
                return(true);
            }
        }
示例#5
0
        public DataTable find_Survey(string _prodmonth, string _sectionid, string _workplaceid, string _act)
        {
            theData.SqlStatement =
                " select count(*) cntSurbvey from Survey \r\n " +
                " where Prodmonth = '" + _prodmonth + "' and \r\n " +
                "       WorkplaceID = '" + _workplaceid + "' and \r\n " +
                "       SectionID = '" + _sectionid + "' and \r\n ";
            if (_act == "Stp")
            {
                theData.SqlStatement = theData.SqlStatement + " Activity in (0,9) ";
            }
            else
            {
                theData.SqlStatement = theData.SqlStatement + " Activity = 1 ";
            }
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSurvey", "find_Workplace", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
        public DataTable save_DeleteBussPlan(int _activity, string _startmonth, string _endmonth)
        {
            if (_activity == 0)
            {
                theData.SqlStatement =
                    " delete from BusinessPlan_Stoping \r\n " +
                    " where Prodmonth >= '" + _startmonth + "' and Prodmonth <= '" + _endmonth + "' ";
            }
            else
            {
                theData.SqlStatement =
                    " delete from BusinessPlan_Development \r\n " +
                    " where Prodmonth >= '" + _startmonth + "' and Prodmonth <= '" + _endmonth + "' ";
            }
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsBusinessPlanImport", "get_DeleteBussPlan", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
示例#7
0
        public DataTable get_HierID(string _date, string _sectionid, string _name)
        {
            theData.ConnectionString = connectionString;
            theData.SqlStatement     =
                " select distinct(HierarchicalID) HierID \r\n " +
                " from Seccal sc \r\n " +
                " inner join Section s on \r\n " +
                "   s.Prodmonth = s.Prodmonth \r\n " +
                " where sc.BeginDate <='" + _date + "' and \r\n " +
                "       sc.EndDate >= '" + _date + "' and \r\n " +
                "       s.SectionID = '" + _sectionid + "' and \r\n " +
                "       s.Name = '" + _name + "' ";
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", DBTag, "clsSICReportData", "get_Parameters", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
示例#8
0
        public DataTable get_CubicTypes(string _act)
        {
            if (_act == "Dev")
            {
                theData.SqlStatement =
                    "(select convert(varchar(3),CubicTypeID) CubicTypeID, CubicTypeDesc from Code_CubicTypes " +
                    " where Activity = 1) " +
                    " union " +
                    "(select '' CubicTypeID, '' CubicTypeDesc) ";
            }
            else
            {
                theData.SqlStatement =
                    "(select convert(varchar(3),CubicTypeID) CubicTypeID, CubicTypeDesc from Code_CubicTypes " +
                    " where Activity = 0) " +
                    " union " +
                    "(select '' CubicTypeID, '' CubicTypeDesc) ";
            }
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSurvey", "get_CubicTypes", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
示例#9
0
        public DataTable get_Stoping(string _prodmonth, string _peername)
        {
            theData.SqlStatement       = "[sp_Survey_STP_Load]";
            theData.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            theData.ResultsTableName   = "STP_Survey";

            SqlParameter[] _paramCollection =
            {
                theData.CreateParameter("@ProdMonth", SqlDbType.VarChar,  6, _prodmonth),
                theData.CreateParameter("@SectionID", SqlDbType.Text,    20, _peername),
            };

            theData.ParamCollection = _paramCollection;
            theData.queryReturnType = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSurvey", "get_Stoping", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
        public void AddCyclePlan(string workplaceID, string sectionid, string sectionidMO, string ProdMonth, int Activity, double FL)
        {
            MWDataManager.clsDataAccess _NewCyclePlan = new MWDataManager.clsDataAccess();
            _NewCyclePlan.ConnectionString = TConnections.GetConnectionString(systemDBTag, UserCurrentInfo.Connection);

            _NewCyclePlan.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            _NewCyclePlan.queryReturnType    = MWDataManager.ReturnType.DataTable;
            // _NewWorkPlace.SqlStatement = "spAddPrePlanningWorkPlace";
            _NewCyclePlan.SqlStatement = "sp_LoadPlanningCycleWP";


            SqlParameter[] _paramCollection =
            {
                _NewCyclePlan.CreateParameter("@workplaceID", SqlDbType.VarChar,  12, workplaceID),
                _NewCyclePlan.CreateParameter("@sectionid",   SqlDbType.VarChar,  20, sectionid),
                _NewCyclePlan.CreateParameter("@sectionidMO", SqlDbType.VarChar, 100, sectionidMO),
                _NewCyclePlan.CreateParameter("@ProdMonth",   SqlDbType.Int,       0, ProdMonth),
                _NewCyclePlan.CreateParameter("@Activity",    SqlDbType.Int,       0, Activity),
                _NewCyclePlan.CreateParameter("@FL",          SqlDbType.Int,       0, FL),
            };

            _NewCyclePlan.ParamCollection = _paramCollection;

            clsDataResult exr = _NewCyclePlan.ExecuteInstruction();

            if (exr.success)
            {
                planningCycle.LoadPlanningCycleData(_NewCyclePlan.ResultsDataTable);
            }
        }
示例#11
0
        public DataTable get_PlanCrews(string _prodmonth, string _sectionid, string _workplaceid, string _act)
        {
            theData.SqlStatement =
                "select  OrgUnitDay, OrgUnitAfternoon, OrgUnitNight " +
                " from PlanMonth " +
                " where ProdMonth = '" + _prodmonth + "'and  " +
                "      SECTIONID = '" + _sectionid + "' and " +
                "      WorkplaceID = '" + _workplaceid + "' and \r\n " +
                "      PlanCode='MP' and IsCubics = 'N' and ";
            if (_act == "Dev")
            {
                theData.SqlStatement = theData.SqlStatement + " Activity = 1 ";
            }
            else
            {
                theData.SqlStatement = theData.SqlStatement + " Activity in (0,9) ";
            }
            //theData.SqlStatement = theData.SqlStatement + " order by CalendarDate desc ";
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSurvey", "get_PlanCrews", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
        public bool save_BusPlan(string _version, string _comp, string _account, string _projno,
                                 string _projtask, string _resp, string _occ, string _period,
                                 string _source, string _budvaltype, string _budval, string _allbudval)
        {
            theData.SqlStatement =
                " INSERT INTO TM1Import \r\n " +
                " (VERSION_DSC ,COMPANY_NAME, ACCOUNT_NO, \r\n " +
                "  PROJECT_NO, PROJECT_TASK, RESP_CENTER, \r\n " +
                "  OCCUPATION_CD, FISCAL_PERIOD, SOURCE_IND, \r\n " +
                "  BUD_VAL_TYPE, BUD_VAL, POST_ALLOC_BUD_VAL) \r\n " +
                "  VALUES \r\n " +
                " ('" + _version + "','" + _comp + "','" + _account + "', \r\n " +
                "  '" + _projno + "','" + _projtask + "' ,'" + _resp + "', \r\n " +
                "  '" + _occ + "', '" + _period + "','" + _source + "', \r\n " +
                "  '" + _budvaltype + "','" + _budval + "','" + _allbudval + "') ";
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.longNumber;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsBusinessPlanImport", "save_BusPlan", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(false);
            }
            else
            {
                return(true);
            }
        }
示例#13
0
        public DataTable find_TheWP(string _prodmonth, string _contractor, string _workplaceid, string _seqno, string _act)
        {
            theData.SqlStatement =
                "select * from Survey " +
                "where ProdMonth = '" + _prodmonth + "'and  " +
                "      SECTIONID = '" + _contractor + "' and " +
                "      WorkplaceID = '" + _workplaceid + "' and " +
                "      SeqNo = '" + _seqno + "' and ";
            if (_act == "Dev")
            {
                theData.SqlStatement = theData.SqlStatement + " Activity = 1 ";
            }
            else
            {
                theData.SqlStatement = theData.SqlStatement + " Activity in (0,9) ";
            }
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSurvey", "getfind_Workplace", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
        public DataTable get_MinMaxMonths(string theFDate, string theTDate)
        {
            theData.ConnectionString = connectionString;
            theData.SqlStatement     =
                " select max(MinProd) MinProd, max(MaxProd) MaxProd \r\n " +
                " from \r\n " +
                " ( \r\n " +
                "  select min(sc.PRODMONTH) MinProd, 0 MaxProd \r\n " +
                "  from SECTION_COMPLETE sc \r\n " +
                "  inner join SECCAL s on \r\n " +
                "    s.Prodmonth = sc.Prodmonth and \r\n " +
                "    s.SectionID = sc.SECTIONID_1  \r\n " +
                "  where s.BeginDate <= '" + theFDate + "' and s.EndDate >= '" + theFDate + "' \r\n " +
                "  union \r\n " +
                "  select 0, max(sc.PRODMONTH) MaxProd \r\n " +
                "  from SECTION_COMPLETE sc \r\n " +
                "  inner join SECCAL s on \r\n " +
                "    s.Prodmonth = sc.Prodmonth and  \r\n " +
                "    s.SectionID = sc.SECTIONID_1  \r\n " +
                "  where s.BeginDate <= '" + theTDate + "' and s.EndDate >= '" + theTDate + "' \r\n " +
                "   ) a ";
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", DBTag, "clsBookingsABS", "get_MinMaxMonths", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
示例#15
0
        public DataTable get_CleanTypes(string _act)
        {
            if (_act == "Dev")
            {
                theData.SqlStatement =
                    "select convert(varchar(7),CleanTypeID) CleanTypeID, CleanTypeDesc from Code_CleanTypes " +
                    "where CleanTypeDesc in ('Haulage Vampings', 'X/C Vampings', 'T/W Vampings', 'B/H Vampings') " + // Added - Shaista Anjum Exclude these 4 items - 13/FEB/2013
                    "union all " +
                    "select '' CleanTypeID, '' CleanTypeDesc order by CleanTypeID";
            }
            else
            {
                theData.SqlStatement =
                    "select convert(varchar(7),CleanTypeID) CleanTypeID, CleanTypeDesc from Code_CleanTypes " +
                    "WHERE CleanTypeDesc NOT IN('Haulage Vampings', 'X/C Vampings', 'T/W Vampings', 'B/H Vampings') " + // Added - Shaista Anjum Exclude these 4 items - 13/FEB/2013
                    "union " +
                    "select '' CleanTypeID, '' CleanTypeDesc ";
            }
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSurvey", "get_CleanTypes", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
示例#16
0
        public DataTable get_sICDetail(string _prodmonth, string _sectionid, string _workplaceid, string _activity)
        {
            theData.SqlStatement       = "[sp_Report_SIC_Detail]";
            theData.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            theData.ResultsTableName   = "SIC_Detail";

            SqlParameter[] _paramCollection =
            {
                theData.CreateParameter("@ProdMonth",   SqlDbType.VarChar,  6, _prodmonth),
                theData.CreateParameter("@SectionID",   SqlDbType.Text,    20, _sectionid),
                theData.CreateParameter("@WorkplaceID", SqlDbType.Text,    12, _workplaceid),
                theData.CreateParameter("@Activity",    SqlDbType.Text,     1, _activity),
            };

            theData.ParamCollection = _paramCollection;
            theData.queryReturnType = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
示例#17
0
        public DataTable get_Sections(string _date)
        {
            theData.ConnectionString = connectionString;
            theData.SqlStatement     =
                " select distinct(Name) Name, SectionID SectionID \r\n " +
                " from Section, Sysset ss  \r\n " +
                " where Prodmonth in ( \r\n " +
                "     select distinct(Prodmonth) ProdMonth \r\n " +
                "     from seccal \r\n " +
                "     where BeginDate <= '" + _date + "' and \r\n " +
                "           EndDate >= '" + _date + "') \r\n " +
                " and Hierarchicalid <= ss.MOHIERARCHICALID \r\n " +
                " order by SectionID, Name ";
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", DBTag, "clsSICReportData", "get_Sections", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
示例#18
0
        public DataTable Save_WPAdd(string _prodmonth, string _sectionid, string _workplaceid, string _activity)
        {
            theData.SqlStatement       = "[sp_Insert_Zeros_PlanMonth]";
            theData.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            theData.ResultsTableName   = "STP_Survey_Plan";

            SqlParameter[] _paramCollection =
            {
                theData.CreateParameter("@ProdMonth",   SqlDbType.VarChar,  6, _prodmonth),
                theData.CreateParameter("@SectionID",   SqlDbType.Text,    20, _sectionid),
                theData.CreateParameter("@WorkplaceID", SqlDbType.Text,    12, _workplaceid),
                theData.CreateParameter("@Activity",    SqlDbType.Text,     1, _activity),
            };

            theData.ParamCollection = _paramCollection;
            theData.queryReturnType = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSurvey", "get_WPAdd", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
示例#19
0
        public DataTable find_Plan(string _prodmonth, string _sectionid, string _workplaceid, string _act)
        {
            theData.SqlStatement =
                " select SurveyAdded from PlanMonth \r\n " +
                " where Prodmonth = '" + _prodmonth + "' and \r\n " +
                "       WorkplaceID = '" + _workplaceid + "' and \r\n " +
                "       SectionID = '" + _sectionid + "' and \r\n ";
            if (_act == "Stp")
            {
                theData.SqlStatement = theData.SqlStatement + " Activity in (0,9) ";
            }
            else
            {
                theData.SqlStatement = theData.SqlStatement + " Activity = 1 ";
            }
            //if (_act != "0")
            //{
            //    theData.SqlStatement =
            //            " select sum(Cubics) Cubics, sum(SQM) Sqm, sum(0) Adv from PlanMonth \r\n " +
            //            " where Prodmonth = '" + _prodmonth + "' and \r\n " +
            //            "       WorkplaceID = '" + _workplaceid + "' and \r\n " +
            //            "       SectionID = '" + _sectionid + "' and \r\n ";
            //    if (_act == "Stp")
            //        theData.SqlStatement = theData.SqlStatement + " Activity in (0,9) ";
            //    else
            //        theData.SqlStatement = theData.SqlStatement + " Activity = 1 ";
            //}
            //else
            //{
            //    theData.SqlStatement =
            //            " select sum(0) Cubics, sum(0) Sqm, sum(Adv) Adv from PlanMonth \r\n " +
            //            " where Prodmonth = '" + _prodmonth + "' and \r\n " +
            //            "       WorkplaceID = '" + _workplaceid + "' and \r\n " +
            //            "       SectionID = '" + _sectionid + "' and \r\n ";
            //    if (_act == "Stp")
            //        theData.SqlStatement = theData.SqlStatement + " Activity in (0,9) ";
            //    else
            //        theData.SqlStatement = theData.SqlStatement + " Activity = 1 ";
            //    //"       Startdate = PlanEndDate", ";
            //}
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSurvey", "getfind_Workplace", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
示例#20
0
        public void sendRequest(string theSystemDBTag, string userConnection)
        {
            MWDataManager.clsDataAccess _sendRequest = new MWDataManager.clsDataAccess();
            _sendRequest.ConnectionString   = TConnections.GetConnectionString(theSystemDBTag, userConnection);
            _sendRequest.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            _sendRequest.queryReturnType    = MWDataManager.ReturnType.DataTable;
            _sendRequest.SqlStatement       = "sp_RevisedPLanning_Request";



            SqlParameter[] _paramCollectionS =
            {
                _sendRequest.CreateParameter("@requestType",    SqlDbType.Int,       0, _requestType),
                _sendRequest.CreateParameter("@ProdMonth",      SqlDbType.Int,       0, _ProdMonth),
                _sendRequest.CreateParameter("@WorkplaceID",    SqlDbType.VarChar,  50, _WorkplaceID),
                _sendRequest.CreateParameter("@SectionID",      SqlDbType.VarChar,  20, _SectionID),
                _sendRequest.CreateParameter("@SectionID_2",    SqlDbType.VarChar,  20, _SectionID_2),
                _sendRequest.CreateParameter("@DayCrew",        SqlDbType.VarChar,  50, _DayCrew),
                _sendRequest.CreateParameter("@NightCrew",      SqlDbType.VarChar,  50, _NightCrew),
                _sendRequest.CreateParameter("@AfternoonCrew",  SqlDbType.VarChar,  50, _AfternoonCrew),
                _sendRequest.CreateParameter("@RovingCrew",     SqlDbType.VarChar,  50, _RovingCrew),
                _sendRequest.CreateParameter("@StartDate",      SqlDbType.VarChar,  20, String.Format("{0:yyy/MM/dd}",_StartDate)),
                _sendRequest.CreateParameter("@StopDate",       SqlDbType.VarChar,  20, String.Format("{0:yyy/MM/dd}",_StopDate)),
                _sendRequest.CreateParameter("@UserComments",   SqlDbType.VarChar, 600, _UserComments),
                _sendRequest.CreateParameter("@RequestBy",      SqlDbType.VarChar,  20, TUserInfo.UserID),
                _sendRequest.CreateParameter("@SQMOn",          SqlDbType.Float,     0, _SQMOn),
                _sendRequest.CreateParameter("@SQMOff",         SqlDbType.Float,     0, _SQMOff),
                _sendRequest.CreateParameter("@Cube",           SqlDbType.Float,     0, _Cube),
                _sendRequest.CreateParameter("@MeterOn",        SqlDbType.Float,     0, _MeterOn),
                _sendRequest.CreateParameter("@MeterOff",       SqlDbType.Float,     0, _MeterOff),
                _sendRequest.CreateParameter("@MiningMethod",   SqlDbType.VarChar,  20, _MiningMethod),
                _sendRequest.CreateParameter("@OldWorkplaceID", SqlDbType.VarChar,  50, _OldWorkplaceID),
                _sendRequest.CreateParameter("@activity",       SqlDbType.Int,       0, _activity),
                _sendRequest.CreateParameter("@Facelength",     SqlDbType.Int,       0, _Facelength),
                _sendRequest.CreateParameter("@DrillRig",       SqlDbType.VarChar, 150, _DrillRig),
                _sendRequest.CreateParameter("@DeleteBookings", SqlDbType.Bit,     150, _DeleteBookings)
            };

            StringBuilder tempstring = new StringBuilder();

            foreach (SqlParameter a in _paramCollectionS)
            {
                //x += 1;
                tempstring.AppendLine(a.ParameterName.ToString() + " = " + a.SqlValue.ToString() + ",");
            }

            _sendRequest.ParamCollection = _paramCollectionS;
            clsDataResult DataResults = _sendRequest.ExecuteInstruction();

            if (DataResults.success == false)
            {
                MessageBox.Show(DataResults.Message, "Error sending request!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void CalcTotalShifts()
        {
            try
            {
                if (dteBeginDate.EditValue != null && dteBeginDate.EditValue.ToString() != string.Empty &&
                    dteEndDate.EditValue != null &&
                    dteEndDate.EditValue.ToString() != string.Empty)
                {
                    if (Convert.ToDateTime(dteBeginDate.EditValue) <= Convert.ToDateTime(dteEndDate.EditValue))
                    {
                        MWDataManager.clsDataAccess _dbManDate = new MWDataManager.clsDataAccess();
                        _dbManDate.ConnectionString = TConnections.GetConnectionString(resWPAS.systemDBTag,
                                                                                       UserCurrentInfo.Connection);
                        _dbManDate.SqlStatement = "select COUNT(Workingday) from CALTYPE " +
                                                  " where CalendarCode = '" +
                                                  cmbCalTypes.Text +
                                                  "' and " +
                                                  " Workingday = 'Y' and " +
                                                  " CalendarDate >= '" +
                                                  String.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(dteBeginDate.EditValue)) +
                                                  "' and " +
                                                  " CalendarDate <= '" +
                                                  String.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(dteEndDate.EditValue)) +
                                                  "'  ";
                        _dbManDate.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
                        _dbManDate.queryReturnType    = MWDataManager.ReturnType.DataTable;
                        dataresult = _dbManDate.ExecuteInstruction();

                        if (!dataresult.success)
                        {
                            Mineware.Systems.Global.sysNotification.TsysNotification.showNotification("Error", dataresult.Message, Color.Red);
                        }

                        lblTotalShifts.Text = _dbManDate.ResultsDataTable.Rows[0][0].ToString();
                        TotalShifts         = lblTotalShifts.Text;
                    }

                    else
                    {
                        //Mineware.Systems.Global.sysNotification.TsysNotification.showNotification("Error",
                        //                                                                          "Start Date cannot be greater than the End Date",
                        //                                                                          Color.Red);
                        //lblTotalShifts.Text = "0";
                    }
                }
            } catch (Exception _exception)
            {
                Mineware.Systems.Global.sysNotification.TsysNotification.showNotification("Error",
                                                                                          _exception.Message,
                                                                                          Color.Red);
            }
        }
        private void AddWorkplace(string WPDesc)
        {
            MWDataManager.clsDataAccess _NewWorkPlace = new MWDataManager.clsDataAccess();
            _NewWorkPlace.ConnectionString = TConnections.GetConnectionString(systemDBTag, UserCurrentInfo.Connection);

            _NewWorkPlace.queryExecutionType = MWDataManager.ExecutionType.StoreProcedure;
            _NewWorkPlace.queryReturnType    = MWDataManager.ReturnType.DataTable;
            // _NewWorkPlace.SqlStatement = "spAddPrePlanningWorkPlace";
            _NewWorkPlace.SqlStatement = "sp_PrePlanning_AddWorkplace";


            SqlParameter[] _paramCollection =
            {
                _NewWorkPlace.CreateParameter("@Prodmonth",     SqlDbType.Int,       0, Convert.ToInt32(PlanningSettings.ProdMonth)),
                _NewWorkPlace.CreateParameter("@Sectionid_2",   SqlDbType.VarChar,  20, PlanningSettings.MOSectionID),
                _NewWorkPlace.CreateParameter("@WPDESCRIPTION", SqlDbType.VarChar, 100, WPDesc),
                _NewWorkPlace.CreateParameter("@ActivityCode",  SqlDbType.Int,       0, PlanningSettings.ActivityID),
            };

            _NewWorkPlace.ParamCollection = _paramCollection;
            clsDataResult exr = _NewWorkPlace.ExecuteInstruction();

            if (exr.success == false)
            {
                MessageBox.Show(exr.Message);
            }

            if (_NewWorkPlace.ResultsDataTable.Rows.Count != 0)
            {
                CPMBusinessLayer.clsBusinessLayer BMEBL = new CPMBusinessLayer.clsBusinessLayer();
                BMEBL._queryReturnType   = CPMBusinessLayer.ReturnType.DataTable;
                BMEBL.SetsystemDBTag     = systemDBTag;
                BMEBL.SetUserCurrentInfo = this.UserCurrentInfo;

                //  DataTable theDates = new DataTable();
                if (BMEBL.get_BeginEndDates(PlanningSettings.MOSectionID, PlanningSettings.ProdMonth) == true)
                {
                    theDates = BMEBL.ResultsDataTable;
                }

                if (_NewWorkPlace.ResultsDataTable.Rows.Count > 0)
                {
                    foreach (DataRow r in _NewWorkPlace.ResultsDataTable.Rows)
                    {
                        tblPlanningData.ImportRow(r);
                    }
                }
            }
        }
        public Boolean Save_SIC(DataTable dtSic, string _prodmonth, string _sectionid, string _kpi)
        {
            theData.SqlStatement = "";
            theData.SqlStatement =
                " delete b from SICCapture b \r\n " +
                " inner join Code_SICCapture cc on \r\n " +
                "   cc.SICKey = b.sickey \r\n " +
                " where b.MillMonth = '" + _prodmonth + "' and \r\n " +
                "       b.sectionid = '" + _sectionid + "' and \r\n " +
                "       cc.KPI = '" + _kpi + "' \r\n ";
            foreach (DataRow dr in dtSic.Rows)
            {
                string _thedate = string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(dr["CalendarDate"].ToString()));
                if (dr["TheValue"] != null)
                {
                    if (dr["TheValue"].ToString() != "")
                    {
                        if (dr["ShiftNo"] != null)
                        {
                            if (dr["ShiftNo"].ToString() != "N")
                            {
                                theData.SqlStatement = theData.SqlStatement +
                                                       " INSERT INTO SICCapture " +
                                                       " (SicKey, CalendarDate, SectionID, SortHeading \r\n " +
                                                       " ,MillMonth, Value, WorkPlaceID, ProblemCode) \r\n " +
                                                       " VALUES (" +
                                                       " '" + dr["SICKey"].ToString() + "', '" + _thedate + "', " +
                                                       " '" + _sectionid + "', null, '" + _prodmonth + "', " +
                                                       " '" + dr["TheValue"].ToString() + "', null, null) \r\n ";
                            }
                        }
                    }
                }
            }
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSICCapture", "Save_SIC", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(false);
            }
            else
            {
                return(true);
            }
        }
        private void buildSecArray()
        {
            try
            {
                var TheData1 = new MWDataManager.clsDataAccess();
                TheData1.ConnectionString = TConnections.GetConnectionString(resWPAS.systemDBTag,
                                                                             UserCurrentInfo.Connection);
                TheData1.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
                TheData1.SqlStatement       = " delete from sect where userid = '" + TUserInfo.UserID + "' ";

                for (int x = 0; x <= lstApply.Items.Count - 1; x++)
                {
                    xValue = ExtractBeforeColon(lstApply.Items[x].ToString());
                    TheData1.SqlStatement = TheData1.SqlStatement +
                                            " insert into sect (userid, sectionid, calendarCode, begindate, enddate, totalshifts) values " +
                                            " ('" +
                                            TUserInfo.UserID +
                                            "', '" +
                                            xValue +
                                            "', \r\n " +
                                            " '" +
                                            cmbCalTypes.Text +
                                            "', \r\n " +
                                            " '" +
                                            String.Format("{0:yyyy-MM-dd}", dteBeginDate.EditValue) +
                                            "', \r\n " +
                                            " '" +
                                            String.Format("{0:yyyy-MM-dd}", dteEndDate.EditValue) +
                                            "', \r\n " +
                                            " '" +
                                            lblTotalShifts.Text +
                                            "') ";
                }
                TheData1.queryReturnType = MWDataManager.ReturnType.longNumber;
                dataresult = TheData1.ExecuteInstruction();

                if (!dataresult.success)
                {
                    Mineware.Systems.Global.sysNotification.TsysNotification.showNotification("Error", dataresult.Message, Color.Red);
                }
                var dt = new DataTable();
            } catch (Exception _exception)
            {
                Mineware.Systems.Global.sysNotification.TsysNotification.showNotification("Error",
                                                                                          _exception.Message,
                                                                                          Color.Red);
            }
        }
示例#25
0
        public bool save_Temp_MOStartDate(string _date, string _userid)
        {
            theData.ConnectionString = connectionString;
            theData.SqlStatement     =
                " select distinct(sc.SectionID_2) SectionID, s.ProdMonth ProdMonth, \r\n " +
                " s.BeginDate BeginDate, \r\n " +
                " s.EndDate EndDate \r\n " +
                " from SECCAL s \r\n " +
                " inner join Section_Complete sc on \r\n " +
                "   sc.SectionID_1 = s.Sectionid and \r\n " +
                "   sc.Prodmonth = s.Prodmonth \r\n " +
                " where s.BeginDate <= '" + _date + "' and \r\n " +
                "        s.EndDate >= '" + _date + "' ";
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            theData.ExecuteInstruction();

            DataTable dd = theData.ResultsDataTable;

            foreach (DataRow r in dd.Rows)
            {
                theData.SqlStatement       = " Insert into Temp_MOStartDate \r\n ";
                theData.SqlStatement      += "( UserID, ProdMonth, SectionID, StartDate, EndDate) values ( \r\n ";
                theData.SqlStatement      += " '" + _userid + "', \r\n ";
                theData.SqlStatement      += " '" + r["ProdMonth"].ToString() + "', \r\n ";
                theData.SqlStatement      += " '" + r["SectionID"].ToString() + "', \r\n ";
                theData.SqlStatement      += " '" + string.Format("{0:yyyy-MM-dd}", r["BeginDate"]) + "',\r\n ";
                theData.SqlStatement      += " '" + string.Format("{0:yyyy-MM-dd}", r["EndDate"]) + "') ";
                theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
                theData.queryReturnType    = MWDataManager.ReturnType.longNumber;
                theData.ExecuteInstruction();
            }
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.longNumber;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", DBTag, "clsSICReportData", "save_Temp_MOStartDate", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(false);
            }
            else
            {
                return(true);
            }
        }
示例#26
0
        public DataTable get_Sysset()
        {
            theData.SqlStatement       = " select *, theRunDate = Convert(varchar(10), RunDate, 120) from Sysset ";
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSurvey", "get_Sysset", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
        public DataTable save_DeleteTempBussPlan()
        {
            theData.SqlStatement =
                " delete from tempBusPlanImport ";
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsBusinessPlanImport", "get_DeleteBussPlan", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
示例#28
0
        public DataTable get_SurveyVisibles()
        {
            theData.SqlStatement =
                " select * from Survey_Fields ";
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSurvey", "get_PlanDates", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
示例#29
0
        public DataTable get_CheckLockedStatus(string _prodmonth)
        {
            theData.SqlStatement =
                "select Locked from Survey_Locks where ProdMonth = '" + _prodmonth + "'";
            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", resWPAS.systemTag, "clsSurvey", "get_CheckLockedStatus", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }
        public DataTable get_MinMaxDatesForSection(string theFPMonth, string theTPMonth, string theSectionID, string theHierID)
        {
            theData.ConnectionString = connectionString;
            theData.SqlStatement     = " select min(s.BeginDate) StartDate, max(s.EndDate) EndDate \r\n " +
                                       " from Seccal s \r\n " +
                                       " inner join Section_Complete sc on \r\n " +
                                       "   sc.ProdMonth = s.ProdMonth and \r\n " +
                                       "   sc.SectionID_1 = s.SectionID \r\n " +
                                       " where s.ProdMonth >= '" + theFPMonth + "' and s.ProdMonth <= '" + theTPMonth + "'  \r\n ";
            if (theHierID == "5")
            {
                theData.SqlStatement = theData.SqlStatement + " and sc.sectionID_1  = '" + theSectionID + "' ";
            }
            if (theHierID == "4")
            {
                theData.SqlStatement = theData.SqlStatement + " and sc.sectionID_2  = '" + theSectionID + "' ";
            }
            if (theHierID == "3")
            {
                theData.SqlStatement = theData.SqlStatement + " and sc.sectionID_3  = '" + theSectionID + "' ";
            }
            if (theHierID == "2")
            {
                theData.SqlStatement = theData.SqlStatement + " and sc.sectionID_4  = '" + theSectionID + "' ";
            }
            if (theHierID == "1")
            {
                theData.SqlStatement = theData.SqlStatement + " and sc.sectionID_5 = '" + theSectionID + "' ";
            }

            theData.queryExecutionType = MWDataManager.ExecutionType.GeneralSQLStatement;
            theData.queryReturnType    = MWDataManager.ReturnType.DataTable;
            clsDataResult errorMsg = theData.ExecuteInstruction();

            if (errorMsg.success == false)
            {
                _sysMessagesClass.viewMessage(MessageType.Error, "SQL ERROR", DBTag, "clsBookingsABS", "get_MinMaxDatesForSection", errorMsg.Message, ButtonTypes.OK, MessageDisplayType.FullScreen);
                return(theData.ResultsDataTable);
            }
            else
            {
                return(theData.ResultsDataTable);
            }
        }