Example #1
0
 public void LoadRptFromNode(XmlElement Node)
 {
     try
     {
         key  = System.Guid.NewGuid().ToString();
         desc = CABCXML.GetValFromNode(Node, "desc", "报表系统");
         foreach (XmlElement item in Node.ChildNodes)
         {
             string skey = item.Name;
             if (skey.ToLower().Substring(0, 3) == "dir")
             {
                 CWLRptDir ndir = new CWLRptDir();
                 ndir.LoadRptFromNode(item);
                 ndir.key = System.Guid.NewGuid().ToString();
                 LsDir.Add(ndir);
             }
             if (skey.ToLower().Substring(0, 3) == "rpt")
             {
                 CWLRpt nrpt = new CWLRpt();
                 nrpt.LoadFromNode(item);
                 nrpt.key  = System.Guid.NewGuid().ToString();
                 nrpt.PDir = this;
                 LsRpt.Add(nrpt);
             }
         }
     }
     catch (Exception e)
     {
     }
 }
Example #2
0
 public CWLRptDir GetDirByKey(string skey)
 {
     if (this.key == skey)
     {
         return(this);
     }
     foreach (CWLRptDir dir in LsDir)
     {
         if (dir.key == skey)
         {
             return(dir);
         }
         CWLRptDir ddir = dir.GetDirByKey(skey);
         if (ddir != null)
         {
             return(ddir);
         }
     }
     return(null);
 }