public static RecvData CreateRecvData(IData data) { RecvData data2; data2.ResultData = null; data2.OtherData = null; data2.MData = null; if (data.Header.DataType == "M") { data2.MData = data; data2.ResultData = (IData) data.Clone(); if (data2.ResultData.ItemCount > 1) { data2.ResultData.Items.RemoveRange(1, data2.ResultData.ItemCount - 1); } data2.ResultData.Header.DataType = "R"; data2.ResultData.Header.Div = "000"; data2.ResultData.Header.EndFlag = " "; data2.ResultData.CalcLength(); data2.OtherData = (IData) data.Clone(); data2.OtherData.Items.RemoveAt(0); data2.OtherData.Header.DataType = "C"; data2.OtherData.Header.Div = "001"; data2.OtherData.Header.EndFlag = "E"; data2.OtherData.CalcLength(); return data2; } if (data.Header.DataType == "R") { data2.ResultData = data; return data2; } data2.OtherData = data; return data2; }