Пример #1
0
        public XmlDocument QueryReportListFromWebservice(string brxm, string lxdh)
        {
            XmlDocument doc = new XmlDocument();

            try
            {
                ArrayList values    = new ArrayList();
                string    error_msg = "";
                string    endTime   = DateTime.Now.AddDays(1).ToString(AppUtils.DateTime_FormatNO_YearMonthDay);
                string    startTime = DateTime.Now.AddDays(-60).ToString(AppUtils.DateTime_FormatNO_YearMonthDay);
                //DateTime endTime = DateTime.Now;
                //DateTime startTime = DateTime.Now.AddDays(-60);

                ReportInfoHandleForWZSZYY pdb = new ReportInfoHandleForWZSZYY();
                int ret = pdb.ReportInfoList(brxm, lxdh, startTime, endTime, 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 (ReportInfo ri in values)
                    {
                        XmlElement eleValue = doc.CreateElement(AppUtils.Tag_REXML_Value);

                        string[] tags = { AppUtils.Tag_Payment_BGDH, AppUtils.Tag_Payment_SJMD, AppUtils.Tag_Payment_CJSJ, AppUtils.Tag_Payment_SJR,
                                          AppUtils.Tag_Payment_JYSJ, AppUtils.Tag_Payment_JYR,  AppUtils.Tag_Payment_SHR,  AppUtils.Tag_Payment_JZCH,
                                          AppUtils.Tag_Payment_ZDJG, AppUtils.Tag_Payment_BBMC, AppUtils.Tag_Payment_MZBZ, AppUtils.Tag_Payment_DYJB,
                                          AppUtils.Tag_Payment_BZ,   AppUtils.Tag_Payment_HZHB, AppUtils.Tag_Query_SBM,    AppUtils.Tag_Query_JGMC };

                        foreach (string tag in tags)
                        {
                            string     value  = ri.getValue(tag);
                            XmlElement eleTag = doc.CreateElement(tag);
                            eleTag.InnerText = (null != value) ? value : "";
                            eleValue.AppendChild(eleTag);
                        }
                        eleMsg.AppendChild(eleValue);
                    }
                }
                else
                {
                    doc = ErrorReturnXml(ret, error_msg);
                }
            }
            catch (Exception ex)
            {
                doc = ReplyXmlDoc.GetExceptionXML(AppUtils.Default_Exception_Code, ex);
            }

            return(doc);
        }