private Boolean DataToEOD(String PathName) { try { String EODText = String.Empty; foreach (var a in this.DataList) { EODText += a.OrderType + "|"; EODText += a.HmBillCode + "|"; EODText += a.OrderCode + "|"; EODText += a.ClientNo + "|"; EODText += a.WD + "|"; EODText += DataHandling.ToTraditionalChinese(a.Area) + "|"; EODText += a.Code + "|"; EODText += a.Dshk + "|"; EODText += a.Dshk_Money + "|"; EODText += a.Df + "|"; EODText += a.PayType + "|"; EODText += DataHandling.ToTraditionalChinese(a.Signer) + "|"; EODText += a.SignerTel + "|"; EODText += a.SignerPhone + "|"; EODText += a.SignerZip + "|"; EODText += DataHandling.ToTraditionalChinese(a.SignerAddress) + "|"; EODText += DataHandling.ToTraditionalChinese(a.Senter) + "|"; EODText += a.SenterTel + "|"; EODText += a.SenterPhone + "|"; EODText += a.SenterZip + "|"; EODText += DataHandling.ToTraditionalChinese(a.SenterAddress) + "|"; EODText += a.SentDate + "|"; EODText += a.GetTime + "|"; EODText += a.SendTime + "|"; EODText += a.Client + "|"; EODText += DataHandling.ToTraditionalChinese(a.GoodsName) + "|"; EODText += a.Goods_Ys + "|"; EODText += a.Goods_Yq + "|"; EODText += a.Rem.Replace("\r\n", "").Replace("\r", "").Replace("\n", "") + "|"; EODText += a.SDCode + "|\r\n"; } FileStream Fs = new FileStream(PathName, FileMode.Append); Byte[] EODByte = System.Text.Encoding.Default.GetBytes(EODText); Fs.Write(EODByte, 0, EODByte.Length); Fs.Close(); return(true); } catch { return(false); } }
private Boolean DataToTxt(String FileName) { try { String SaveTxt = String.Empty; foreach (var Obj in this.DataList) { SaveTxt += Obj.SentSite + " "; SaveTxt += Obj.ClientID + " "; SaveTxt += Obj.Senter + " "; SaveTxt += Obj.SenterPhone + " "; SaveTxt += Obj.SenterTel + " "; SaveTxt += Obj.SenterAddress + " "; SaveTxt += Obj.SentDate + " "; SaveTxt += Obj.SentNo + " "; SaveTxt += Obj.DescNo + " "; SaveTxt += Obj.ClientOrderNo + " "; SaveTxt += DataHandling.ToTraditionalChinese(Obj.Signer) + " "; SaveTxt += Obj.SignerNo + " "; SaveTxt += Obj.SignerPhone + " "; SaveTxt += Obj.ZipCode + " "; SaveTxt += DataHandling.ToTraditionalChinese(Obj.SignerAddress) + " "; SaveTxt += Obj.SignerTel + " "; SaveTxt += Obj.Zip_Code + " "; SaveTxt += DataHandling.ToTraditionalChinese(Obj.SignerAddress_2) + " "; SaveTxt += Obj.SendDate + " "; SaveTxt += Obj.CFBillCode + " "; SaveTxt += Obj.SignSite + " "; SaveTxt += Obj.GoodsType + " "; SaveTxt += Obj.GoodsName + " "; SaveTxt += Obj.GoodsCount + " "; SaveTxt += Obj.GoodsWeight + " "; SaveTxt += Obj.GoodsNo + " "; SaveTxt += Obj.GetMoney + " "; SaveTxt += Obj.Rem.Replace("\r\n", "").Replace("\r", "").Replace("\n", "") + " "; SaveTxt += Obj.PackNo + " "; SaveTxt += "\r\n"; } FileStream Fs = new FileStream(FileName, FileMode.Append); Byte[] EODByte = System.Text.Encoding.Default.GetBytes(SaveTxt); Fs.Write(EODByte, 0, EODByte.Length); Fs.Close(); return(true); } catch { return(false); } }