Example #1
0
        /// <summary>
        /// 取药查询
        /// </summary>
        /// <param name="brxm">病人</param>
        /// <param name="lxdh">联系电话</param>
        /// <returns></returns>
        public XmlDocument QueryPatientDrugInfo(string brxm, string lxdh)
        {
            XmlDocument doc = new XmlDocument();

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

                QueryDB pdb = new QueryDB();
                int     ret = pdb.DB_QueryPatientDrugInfo(brxm, lxdh, out _list, out error_msg);

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

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

                    XmlElement eleResult = doc.CreateElement(AppUtils.Tag_REXML_Result);
                    eleResult.InnerText = AppUtils.Value_Return_Success;
                    root.AppendChild(eleResult);

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

                        XmlElement eleKfrq = doc.CreateElement(AppUtils.Tag_Payment_KFRQ);
                        eleValue.AppendChild(eleKfrq);
                        //以下实现数据操作逻辑
                        eleKfrq.InnerText = pdi.rq;

                        XmlElement eleQyxh = doc.CreateElement(AppUtils.Tag_Payment_QYXH);
                        eleValue.AppendChild(eleQyxh);
                        //以下实现数据操作逻辑
                        eleQyxh.InnerText = pdi.xh;

                        XmlElement eleCfzt = doc.CreateElement(AppUtils.Tag_Payment_CFZT);
                        eleValue.AppendChild(eleCfzt);
                        //以下实现数据操作逻辑
                        eleCfzt.InnerText = pdi.zt;
                    }
                }
                else
                {
                    doc = ErrorReturnXml(ret, error_msg);
                }
            }
            catch (Exception ex)
            {
                doc = ReplyXmlDoc.GetExceptionXML(AppUtils.Default_Exception_Code, ex);
            }
            return(doc);
        }