示例#1
0
        private static void loadSecurity()
        {
            string lFile = RsViewEngine.ProfileManager.SecurityFile;

            if (!File.Exists(lFile))
            {
                _Security = CSecurityData.CreateNew();
                _Security.Save(lFile);
            }
            else
            {
                if (RsOldSecurity.IsOldFormat(lFile))
                {
                    RsOldSecurity.ConvertToNew(lFile);
                }

                _Security = new CSecurityData();
                _Security.Load(lFile);
            }
        }
示例#2
0
        public static void ConvertToNew(string aFile)
        {
            CSecurityData lNewDoc = CSecurityData.CreateNew();
            XmlDocument   lOldDoc = new XmlDocument();

            lOldDoc.Load(aFile);
            XmlNode lRootNode = XmlTools.getXmlNodeByName("ReportSmartSecurity", lOldDoc);

            foreach (XmlNode iNode in lRootNode)
            {
                CSecurityNode iSecNode = CSecurityData.AddSecNode(
                    lNewDoc,
                    XmlTools.GetAttrib(iNode, "datasource"),
                    iNode.Name
                    );
                iSecNode.UserName = XmlTools.GetAttrib(iNode, "userid");
                iSecNode.Password = XmlTools.GetAttrib(iNode, "passwd");
            }
            lNewDoc.Save(aFile);
        }
示例#3
0
 public static void SaveSecurity()
 {
     _Security.Save(RsViewEngine.ProfileManager.SecurityFile);
 }