コード例 #1
0
ファイル: OrderEditForm.cs プロジェクト: distinct2010/dp2
        public static void SetXml(ItemEditControlBase control,
                                  string strXml,
                                  string strPublicationType)
        {
            string strError = "";

            // 去掉记录里面的 issueCount 和 range 元素
            if (string.IsNullOrEmpty(strXml) == false &&
                strPublicationType == "book")
            {
                XmlDocument dom = new XmlDocument();
                DomUtil.SafeLoadXml(dom, strXml);
                DomUtil.DeleteElement(dom.DocumentElement, "range");
                DomUtil.DeleteElement(dom.DocumentElement, "issueCount");
                strXml = dom.DocumentElement.OuterXml;
            }

            int nRet = control.SetData(strXml, "", null, out strError);

            if (nRet == -1)
            {
                throw new Exception(strError);
            }
        }