示例#1
0
        public int ImportXomItemForBom(ref BomParam param0, ref int id, ref int slino)
        {
            int      Result = 0;
            string   ls = "", childxml = "";
            XmlNode  node  = null;
            BomParam param = new BomParam();
            TExpress exp   = new TExpress();

            param.blockmemo = "";
            XmlNode root = param0.rootnode;
            string  str  = GetAttributeValue(root, "模块备注", "", "");

            if (str != "")
            {
                param0.blockmemo = str;
                param0.blockmemo = param0.blockmemo.Replace("[宽]", param0.pl.ToString());
                param0.blockmemo = param0.blockmemo.Replace("[深]", param0.pd.ToString());
                param0.blockmemo = param0.blockmemo.Replace("[高]", param0.ph.ToString());
            }
            str = GetAttributeValue(root, "类别", "", "");
            if ((str == "趟门,趟门") || (str == "掩门,掩门"))
            {
                node = root.SelectSingleNode("模板");
                if (node != null)
                {
                    childxml = "";
                    if (node.ChildNodes.Count > 0)
                    {
                        childxml = node.ChildNodes[0].OuterXml;
                    }
                    return(0);
                }
            }

            node = root.SelectSingleNode("我的模块");
            if (node != null)
            {
                for (int i = 0; i <= node.ChildNodes.Count - 1; i++)
                {
                    XmlNode cnode = node.ChildNodes[i];
                    if ((cnode.Name != "板件") && (cnode.Name != "五金") && (cnode.Name != "型材五金") && (cnode.Name != "模块") && (cnode.Name != "门板"))
                    {
                        continue;
                    }
                    childxml = "";
                    if (cnode.ChildNodes.Count > 0)
                    {
                        childxml = cnode.ChildNodes[0].OuterXml;
                    }
                    if (childxml != "")
                    {
                        param = param0;
                        if (cnode.ChildNodes.Count > 0)
                        {
                            param.rootnode = cnode.ChildNodes[0];
                            param.xdoc     = param0.xdoc;
                            int childnum = ImportXomItemForBom(ref param, ref id, ref slino);
                        }
                    }
                }
            }

            return(0);
        }
示例#2
0
 static void Main(string[] args)
 {
     if (args.Length >= 3)
     {
         string datafile = args[0];
         string savefile = args[1];
         string format   = args[2];
         if (format == "datamatrix")
         {
             DoConvert_DataMatrix(datafile);
         }
         else
         {
             DoConvert(datafile, savefile, format);
         }
     }
     else
     {
         /*char[] OpSymbolArray = { '1', '2', ' '};
          *
          * char[] tmp = new char[64];
          * tmp[0] = '1';
          * tmp[1] = '\0';
          * string str = new string(OpSymbolArray);
          * //MessageBox.Show(str);
          * string a = str.ToString() + "123";
          * MessageBox.Show(a);
          * //MessageBox.Show("456" + "123");
          * char buf = '+';
          * string str1 = str;
          * int b = int.Parse(str1);
          * MessageBox.Show(int.Parse(str1).ToString());
          * if (OpSymbolArray.Contains(buf))
          * {
          *  //MessageBox.Show("hello");
          *
          * }
          * if (buf.ToString() == "+")
          * {
          * // MessageBox.Show("hello1");
          * }
          * string xmlfile = args[0];
          * string xml = System.IO.File.ReadAllText(xmlfile, System.Text.Encoding.Default);
          * char[] buf1 = xml.ToCharArray();
          *
          * char c3 = (char)0;
          * for (int i = 0; i < xml.Length; i++)
          * {
          *  if (buf1[i] == 0)
          *  {
          *      MessageBox.Show("Hello2");
          *  }
          * }
          *
          *
          * string xmlfile = args[0];
          * string xml = System.IO.File.ReadAllText(xmlfile, System.Text.Encoding.Default);
          * BomApi bom = new BomApi();
          * bom.LoadXML2Bom(xml);*/
         TExpress exp = new TExpress();
         bool     str = exp.IsNumeric("1223addd");
     }
 }