public bool Save_before(ref IXMLDOMDocument2 domhead, ref IXMLDOMDocument2 dombody, ref string errMsg)
        {
            MomCallContext  currentMomCallContext = MomCallContextCache.Instance.CurrentMomCallContext;
            clsLogin        clsLogin = (clsLogin)currentMomCallContext.U8Login;
            IXMLDOMNodeList headval  = domhead.selectNodes("//rs:data/z:row");
            IXMLDOMNodeList bodyval  = dombody.selectNodes("//rs:data/z:row");

            string csocode = "", ddate = "", ccuscode = "", ccusname = "";
            string cinvcode = "", iquantity = "", iunitprice = "", cinvname = "";

            wl.WriteLogs("-------head start ------" + domhead.xml + "-----head end ------------");

            wl.WriteLogs("-------body start ------" + dombody.xml + "-----body end ------------");

            //销售订单头信息
            foreach (IXMLDOMElement item in headval)
            {
                csocode  = item.attributes.getNamedItem("csocode").nodeValue.ToString();
                ddate    = item.attributes.getNamedItem("ddate").nodeValue.ToString();
                ccuscode = item.attributes.getNamedItem("ccuscode").nodeValue.ToString();
                ccusname = item.attributes.getNamedItem("ccusname").nodeValue.ToString();
            }


            //销售订单行信息
            foreach (IXMLDOMElement item in bodyval)
            {
                cinvcode   = item.attributes.getNamedItem("cinvcode").nodeValue.ToString();
                iquantity  = item.attributes.getNamedItem("iquantity").nodeValue.ToString();
                iunitprice = item.attributes.getNamedItem("iunitprice").nodeValue.ToString();
                cinvname   = item.attributes.getNamedItem("cinvname").nodeValue.ToString();
            }

            MessageBox.Show("订单头信息:" + csocode + "-" + ddate + "-" + ccuscode + "-" + ccusname + "\r\n" + "订单行信息:行记录数为" + bodyval.length.ToString() + " ; " + cinvcode + "-" + iquantity + "-" + iunitprice + "-" + cinvname);

            return(true);
        }
Esempio n. 2
0
 private void SetData(IXMLDOMDocument2 doc)
 {
     foreach (IXMLDOMNode xmlNode in doc.selectNodes("//rs:data")[0].selectNodes("//z:row"))
     {
         //string oper = ((IXMLDOMElement)xmlNode).getAttribute("editprop").ToString().ToUpper();
         string oper = (xmlNode as IXMLDOMElement).getAttribute("editprop").ToString().ToUpper();
         if (oper.Equals("A"))
         {
             SetAddData(xmlNode as IXMLDOMElement);
         }
         else if (oper.Equals("D"))
         {
             SetDelData(xmlNode as IXMLDOMElement);
         }
         else if (oper.Equals("M"))
         {
             SetModData(xmlNode as IXMLDOMElement);
         }
         else
         {
             SetDelData(xmlNode as IXMLDOMElement);
         }
     }
 }