Ejemplo n.º 1
0
        /// <summary>
        /// 查询剩余床位数
        /// </summary>
        /// <returns></returns>
        public XmlDocument QueryRemainBeds()
        {
            XmlDocument doc = new XmlDocument();

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

                QueryDB pdb = new QueryDB();
                int     ret = pdb.DB_QueryRemainBeds(out values, out error_msg);

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

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

                    XmlElement eleMsg = doc.CreateElement(AppUtils.Tag_REXML_Message);
                    root.AppendChild(eleMsg);
                    foreach (RemainBeds ri in values)
                    {
                        XmlElement eleValue = doc.CreateElement(AppUtils.Tag_REXML_Value);

                        XmlElement eleBqmc = doc.CreateElement(AppUtils.Tag_Query_Bqmc);
                        eleValue.AppendChild(eleBqmc);
                        eleBqmc.InnerText = ri.bqmc;

                        XmlElement eleSycw = doc.CreateElement(AppUtils.Tag_Query_Sycw);
                        eleValue.AppendChild(eleSycw);
                        eleSycw.InnerText = Convert.ToString(ri.sycw);

                        eleMsg.AppendChild(eleValue);
                    }
                }
                else
                {
                    doc = ErrorReturnXml(ret, error_msg);
                }

                return(doc);
            }
            catch (Exception ex)
            {
                return(ReplyXmlDoc.GetExceptionXML(AppUtils.Default_Exception_Code, ex));
            }
        }