protected override object Serialize(object obj) { DssExportHistory dssExportHistory = (DssExportHistory)obj; DateTime effDate = dssExportHistory.EffectiveDate.HasValue ? dssExportHistory.EffectiveDate.Value : DateTime.Today; string[] line1 = new string[] { DssHelper.GetEventValue(dssExportHistory.EventCode), dssExportHistory.PartyTo, //客户 DssHelper.FormatDate(effDate, dssExportHistory.DssOutboundControl.ExternalSystem.Code), //生效日期 dssExportHistory.PartyFrom, //QAD:Site //"",//零件号 dssExportHistory.Item }; string[] line2 = new string[] { DssHelper.GetEventValue(dssExportHistory.EventCode), dssExportHistory.Item, //零件号 dssExportHistory.Qty.ToString("0.########"), //数量 dssExportHistory.PartyFrom, //QAD:Site dssExportHistory.Location //客户库位 }; string[][] data = new string[][] { line1, line2 }; return(new object[] { effDate, data }); }
protected override object Serialize(object obj) { DssExportHistory dssExportHistory = (DssExportHistory)obj; DateTime effDate = dssExportHistory.EffectiveDate.HasValue ? dssExportHistory.EffectiveDate.Value : DateTime.Today; string[] line1 = new string[] { DssHelper.GetEventValue(dssExportHistory.EventCode), dssExportHistory.PartyFrom, //QAD:Site dssExportHistory.KeyCode, !string.IsNullOrEmpty(dssExportHistory.DefinedString3) ? dssExportHistory.DefinedString3 : dssExportHistory.PartyTo, //客户 null, null, null }; string[] line2 = new string[] { DssHelper.GetEventValue(dssExportHistory.EventCode), dssExportHistory.Item,//零件号 null, null, dssExportHistory.Qty.ToString("0.########"), //数量 dssExportHistory.PartyFrom, //QAD:Site dssExportHistory.Location //客户库位 }; string[][] data = new string[][] { line1, line2 }; return(new object[] { effDate, data }); }
protected override object Serialize(object obj) { DssExportHistory dssExportHistory = (DssExportHistory)obj; DateTime effDate = dssExportHistory.EffectiveDate.HasValue ? dssExportHistory.EffectiveDate.Value : DateTime.Today; string[] line1 = new string[] { DssHelper.GetEventValue(dssExportHistory.EventCode), dssExportHistory.DefinedString1, //开票通知单号 dssExportHistory.ReceiptNo, //收货单号 null, //Line dssExportHistory.Item, //零件号 dssExportHistory.PartyFrom, //供应商 dssExportHistory.Qty.ToString("0.########"), //数量 dssExportHistory.DefinedString2, //币种 dssExportHistory.DefinedString3, //发票单价 dssExportHistory.Uom, //单位 dssExportHistory.DefinedString4, //采购单价 dssExportHistory.DefinedString5, //金额 dssExportHistory.OrderNo, //订单号 DssHelper.FormatDate(effDate, dssExportHistory.DssOutboundControl.ExternalSystem.Code), //收货日期 dssExportHistory.Location, //库位 null //排程单号 }; string[][] data = new string[][] { line1 }; return(new object[] { effDate, data }); }
protected override object Serialize(object obj) { DssExportHistory dssExportHistory = (DssExportHistory)obj; DateTime effDate = dssExportHistory.EffectiveDate.HasValue ? dssExportHistory.EffectiveDate.Value : DateTime.Today; log.Debug("Now write data:" + dssExportHistory.Location + "," + dssExportHistory.Item + "," + dssExportHistory.Qty.ToString("0.##")); string[] line1 = new string[] { DssHelper.GetEventValue(dssExportHistory.EventCode), dssExportHistory.UndefinedString2, //雇员 DssHelper.FormatDate(effDate, dssExportHistory.DssOutboundControl.ExternalSystem.Code), //生效日期 dssExportHistory.PartyTo, //QAD:Site dssExportHistory.Item, //零件号 dssExportHistory.UndefinedString3, //工序 null, null, null, dssExportHistory.Qty.ToString("0.##"), //数量 null, // dssExportHistory.DefinedString1,//废品数 null, // dssExportHistory.DefinedString2,//次品数 null, dssExportHistory.PartyTo, //QAD:Site dssExportHistory.Location //库位 }; List <string[]> dataList = new List <string[]>(); dataList.Add(line1); IList <DssExportHistoryDetail> dssExportHistoryDetailList = dssExportHistory.DssExportHistoryDetails; if (dssExportHistory.DssExportHistoryDetails != null && dssExportHistory.DssExportHistoryDetails.Count > 0) { foreach (DssExportHistoryDetail dssExportHistoryDetail in dssExportHistoryDetailList) { string[] line2 = new string[] { DssHelper.GetEventValue(dssExportHistory.EventCode), dssExportHistoryDetail.Item, //零件号 dssExportHistory.UndefinedString3, //工序 dssExportHistoryDetail.Qty.ToString("0.####"), //数量 dssExportHistory.PartyFrom, //QAD:Site dssExportHistoryDetail.Location //库位 }; dataList.Add(line2); } } string[][] data = dataList.ToArray(); return(new object[] { effDate, data }); }
protected override object Serialize(object obj) { DssExportHistory dssExportHistory = (DssExportHistory)obj; DateTime effDate = dssExportHistory.EffectiveDate.HasValue ? dssExportHistory.EffectiveDate.Value : DateTime.Today; log.Debug("Now write data:" + dssExportHistory.Item + "," + dssExportHistory.ReferenceLocation + "," + dssExportHistory.Location + "," + dssExportHistory.Qty); string[] line1 = new string[] { DssHelper.GetEventValue(dssExportHistory.EventCode), dssExportHistory.Item, //零件号 dssExportHistory.Qty.ToString("0.########"), //数量 DssHelper.FormatDate(effDate, dssExportHistory.DssOutboundControl.ExternalSystem.Code), //生效日期 dssExportHistory.KeyCode, //收货单号 dssExportHistory.PartyFrom, //QAD:Site dssExportHistory.Location, //来源库位 dssExportHistory.PartyFrom, //QAD:Site,销售对应QAD移库,所以取来源区域 dssExportHistory.ReferenceLocation //目的库位 }; string[][] data = new string[][] { line1 }; return(new object[] { effDate, data }); }
protected override object Serialize(object obj) { DssExportHistory dssExportHistory = (DssExportHistory)obj; DateTime effDate = dssExportHistory.EffectiveDate.HasValue ? dssExportHistory.EffectiveDate.Value : DateTime.Today; string[] line1 = new string[] { DssHelper.GetEventValue(dssExportHistory.EventCode), dssExportHistory.Item, //零件号 dssExportHistory.Qty.ToString("0.########"), //数量 dssExportHistory.PartyTo, //QAD:Site dssExportHistory.Location, //库位 dssExportHistory.KeyCode, //单号 DssHelper.FormatDate(effDate, dssExportHistory.DssOutboundControl.ExternalSystem.Code), //生效日期 dssExportHistory.DefinedString1, //账户 dssExportHistory.DefinedString2, //分账户 dssExportHistory.DefinedString3, //成本中心 dssExportHistory.DefinedString4 //项目 }; string[][] data = new string[][] { line1 }; return(new object[] { effDate, data }); }