Exemplo n.º 1
0
        /// <summary>
        /// 交易明细
        /// </summary>
        /// <param name="brid">病人ID</param>
        /// <param name="brlx">病人类型 1:门诊  2:住院</param>
        /// <returns></returns>
        public XmlDocument QueryDetail(string brid, string brlx)
        {
            XmlDocument doc = new XmlDocument();

            try
            {
                ArrayList _list     = new ArrayList();
                string    error_msg = "";

                PaymentDB pdb   = new PaymentDB();
                int       rtint = pdb.DB_QueryDetail(brid, brlx, out _list, out error_msg);

                if (rtint == 0)
                {
                    XmlElement root = doc.CreateElement(AppUtils.Tag_REXML_Root);
                    doc.AppendChild(root);

                    XmlElement eleResult = doc.CreateElement(AppUtils.Tag_REXML_Result);
                    eleResult.InnerText = Convert.ToString(rtint);
                    root.AppendChild(eleResult);

                    XmlElement eleMsg = doc.CreateElement(AppUtils.Tag_REXML_Message);
                    root.AppendChild(eleMsg);

                    foreach (PaymentDetail pdt in _list)
                    {
                        XmlElement eleValue = doc.CreateElement(AppUtils.Tag_REXML_Value);
                        eleMsg.AppendChild(eleValue);

                        XmlElement eleOpdate = doc.CreateElement(AppUtils.Tag_Payment_OPDATE);
                        eleValue.AppendChild(eleOpdate);
                        //以下实现数据操作逻辑
                        eleOpdate.InnerText = pdt.rq.ToString("yyyy-MM-dd");

                        XmlElement eleJe = doc.CreateElement(AppUtils.Tag_Payment_CZJE);
                        eleValue.AppendChild(eleJe);
                        //以下实现数据操作逻辑
                        eleJe.InnerText = pdt.je.ToString("0.00");

                        XmlElement eleItem = doc.CreateElement(AppUtils.Tag_REXML_ITEM);
                        eleValue.AppendChild(eleItem);
                        //以下实现数据操作逻辑
                        eleItem.InnerText = pdt.item;
                    }
                    //eleResult.InnerText = "1";
                }
                else
                {
                    doc = ErrorReturnXml(rtint, error_msg);
                }
            }
            catch (Exception ex)
            {
                doc = ReplyXmlDoc.GetExceptionXML(AppUtils.Default_Exception_Code, ex);
            }

            return(doc);
        }