示例#1
0
        public static bool PrintLabel(PrintLabelParameterData data)
        {
            ModulePrintDataSet    print    = new ModulePrintDataSet();
            ModulePrintDataSetNew printNew = new ModulePrintDataSetNew();
            //BindDataSource(data,print,printNew);
            MethodInfo method = null;
            string     methodNameWithOutDpi = "wf_printlable" + data.LabelNo.PadLeft(2, '0');

            if (method == null)
            {
                method = typeof(ModulePrint).GetMethod(methodNameWithOutDpi);
            }
            if (method != null)
            {
                object[] objs = new object[1];
                //objs[0] = printNew;
                objs[0] = data;
                object retObj = method.Invoke(null, objs);
                if (retObj != null)
                {
                    return(Convert.ToBoolean(retObj));
                }
            }
            return(false);
        }
示例#2
0
        public static void BindDataSource(PrintLabelParameterData data, ModulePrintDataSet print, ModulePrintDataSetNew printNew)
        {
            print.ModulePrint.Rows.Add(new object[] {
                data.Darkness,
                data.X,
                data.Y,
                data.Dpi,
                data.LablePrinterType,
                data.LablePrinterName,
                data.LabelPrinterIP,
                data.LablePrinterPort,
                data.IsPrintNameplate,
                data.IsEnableByProduct,
                data.IVTestDataKey,
                data.WorkOrderKey,
                data.ProductKey,
                data.PowersetKey,
                data.FactoryName,
                data.ProductModel,
                data.LabelNo,
                data.PSign,
                data.LotNo,
                data.WorkOrderNumber,
                data.PartNumber,
                data.ProductCode,
                data.FullPalletQty,
                data.LotCellQty,
                data.ArticleNo,
                data.Celleff,
                data.CalibrationNo,
                data.StandCalibration,
                data.DeviceNum,
                data.TestRuleCode,
                data.MinPower,
                data.MaxPower,
                data.Digits,
                data.PrintQty,
                data.PM,
                data.IPM,
                data.ISC,
                data.VOC,
                data.VPM,
                data.FF,
                data.CTM,
                (!string.IsNullOrEmpty(data.PowersetSubPowerLevel ?? string.Empty) && (data.PowersetSubPowerLevel ?? string.Empty).Length >= 2 && (data.PowersetSubPowerLevel ?? string.Empty).LastIndexOf('-') >= 0)?data.CoefPM.ToString("#,##0.00") + (data.PowersetSubPowerLevel ?? string.Empty).Substring((data.PowersetSubPowerLevel ?? string.Empty).LastIndexOf('-'), 2):data.CoefPM.ToString("#,##0.00"),
                data.CoefISC.ToString("#,##0.00"),
                data.CoefIPM.ToString("#,##0.00"),
                data.CoefVOC.ToString("#,##0.00"),
                data.CoefVPM.ToString("#,##0.00"),
                data.CoefFF,
                data.PowerDifferent,
                data.TestTemperature,
                data.ErrorMessage,
                data.IsPrintErrorMessage,
                data.TestTime,
                data.CalibrationCycle,
                data.IsBCPData,
                data.PowersetCode,
                data.PowersetSeq,
                data.PowersetDemandQty,
                data.PowersetModuleName,
                data.PowersetModuleCode,
                data.PowersetStandardPM,
                data.PowersetStandardISC,
                data.PowersetStandardIPM,
                data.PowersetStandardVOC,
                data.PowersetStandardVPM,
                data.PowersetStandardFuse,
                data.PowersetPowerDifferent,
                data.PowersetSubWay,
                data.PowersetSubPowerLevel,
                data.PowersetSubCode,
                data.CustomerCode,
                data.SlideCode
            });

            printNew.ModulePrintTable.Rows.Add(new object[] {
                (!string.IsNullOrEmpty(data.PowersetSubPowerLevel ?? string.Empty) &&
                 (data.PowersetSubPowerLevel ?? string.Empty).Length >= 2 &&
                 (data.PowersetSubPowerLevel ?? string.Empty).LastIndexOf('-') >= 0)
            ?data.CoefPM.ToString("#,##0.00") + (data.PowersetSubPowerLevel ?? string.Empty).Substring((data.PowersetSubPowerLevel ?? string.Empty).LastIndexOf('-'), 2) + "Wp"
            :data.CoefPM.ToString("#,##0.00") + "Wp",
                data.CoefISC.ToString("#,##0.00").Trim() + "A",
                data.CoefIPM.ToString("#,##0.00").Trim() + "A",
                data.CoefVOC.ToString("#,##0.00").Trim() + "V",
                data.CoefVPM.ToString("#,##0.00").Trim() + "V",
                data.PrintQty.ToString().Trim(),
                data.PowersetModuleCode,
                data.PowersetModuleName,
                data.PowersetStandardPM + "Wp",
                data.PowersetStandardISC.ToString().Trim() + "A",
                data.PowersetStandardVOC.ToString().Trim() + "V",
                data.PowersetStandardIPM.ToString().Trim() + "A",
                data.PowersetStandardVPM.ToString().Trim() + "V",
                data.PM.ToString("#,##0.00").Trim(),
                data.ISC.ToString("#,##0.00").Trim() + "A",
                data.IPM.ToString("#,##0.00").Trim() + "A",
                data.VOC.ToString("#,##0.00").Trim() + "V",
                data.VPM.ToString("#,##0.00").Trim() + "V",
                data.TestTime.ToString("yyyy-MM-dd"),
                data.PowersetStandardFuse.ToString(),
                data.PowersetPowerDifferent,
                data.PowersetSubPowerLevel ?? string.Empty,
                data.ProductModel,
                data.LotNo
            });
        }