예제 #1
0
        public WMSBusinessCollection <OutputParam> CreateReportParams(Dictionary <string, Variable[]> epsReports, string resultReportFile, bool?changeOdbc)
        {
            var result = new WMSBusinessCollection <OutputParam>();

            if (epsReports != null)
            {
                foreach (var p in epsReports)
                {
                    if (!string.IsNullOrEmpty(p.Key))
                    {
                        result.Add(new OutputParam
                        {
                            OutputParamCode  = EpsTaskParams.EpsReport.ToString(),
                            OutputParamValue = p.Key,
                            OutputParamType  = EpsParamType.REP.ToString()
                        });
                        if (p.Value != null)
                        {
                            foreach (var v in p.Value.Where(v => !string.IsNullOrEmpty(v.Value)))
                            {
                                result.Add(new OutputParam
                                {
                                    OutputParamCode     = v.Value,
                                    OutputParamValue    = v.SubValue,
                                    OutputParamSubvalue = p.Key,
                                    OutputParamType     = EpsParamType.REP.ToString()
                                });
                            }
                        }
                    }
                }
            }

            if (!string.IsNullOrEmpty(resultReportFile))
            {
                result.Add(new OutputParam
                {
                    OutputParamCode  = EpsTaskParams.ResultReportFile.ToString(),
                    OutputParamValue = resultReportFile,
                    OutputParamType  = EpsParamType.REP.ToString()
                });
            }

            if (changeOdbc.HasValue)
            {
                result.Add(new OutputParam
                {
                    OutputParamCode  = EpsTaskParams.ChangeODBC.ToString(),
                    OutputParamValue = (changeOdbc.Value ? 1 : 0).ToString(CultureInfo.InvariantCulture),
                    OutputParamType  = EpsParamType.REP.ToString()
                });
            }

            return(result.Any() ? result : null);
        }
예제 #2
0
        public WMSBusinessCollection <OutputParam> CreateEpsParams(bool useZip, bool useReserveCopy)
        {
            var result = new WMSBusinessCollection <OutputParam>();

            if (useZip)
            {
                result.Add(new OutputParam
                {
                    OutputParamCode = EpsTaskParams.Zip.ToString(),
                    OutputParamType = EpsParamType.EPS.ToString()
                });
            }
            if (useReserveCopy)
            {
                result.Add(new OutputParam
                {
                    OutputParamCode = EpsTaskParams.ReserveCopy.ToString(),
                    OutputParamType = EpsParamType.EPS.ToString()
                });
            }
            return(result.Any() ? result : null);
        }