/// <summary> /// to xml /// </summary> /// <returns></returns> public XElement ToXml() { XElement xelem = new XElement(TransDataUtils.XML_ITEM); // line number xelem.Add(new XAttribute(TransDataUtils.XML_LINE_NUM, _lineNum.ToString())); // account type xelem.Add(new XAttribute(TransDataUtils.XML_ACCOUNT_TYPE, ((char)_type).ToString())); // g/l account xelem.Add(new XAttribute(TransDataUtils.XML_GL_ACCOUNT, _glAccount.ToString())); // customer if (_customer != null) { xelem.Add(new XAttribute(TransDataUtils.XML_CUSTOMER, _customer.ToString())); } // vendor if (_vendor != null) { xelem.Add(new XAttribute(TransDataUtils.XML_VENDOR, _vendor.ToString())); } // amount xelem.Add(new XAttribute(TransDataUtils.XML_AMOUNT, _amount.ToNumber())); // credit debit indicator xelem.Add(new XAttribute(TransDataUtils.XML_CD_INDICATOR, ((char)_cdIndicator).ToString())); // business area if (_businessArea != null) { xelem.Add(new XAttribute(TransDataUtils.XML_BUSINESS_AREA, _businessArea.ToString())); } return(xelem); }