private void ParseFolderPermissions(XmlNodeList nodeFolderPermissions, int PortalId, FolderInfo folder)
 {
     Security.Permissions.PermissionController objPermissionController = new Security.Permissions.PermissionController();
     Security.Permissions.FolderPermissionController objFolderPermissionController = new Security.Permissions.FolderPermissionController();
     RoleController objRoleController = new RoleController();
     int PermissionID = 0;
     folder.FolderPermissions.Clear();
     foreach (XmlNode xmlFolderPermission in nodeFolderPermissions)
     {
         string PermissionKey = XmlUtils.GetNodeValue(xmlFolderPermission.CreateNavigator(), "permissionkey");
         string PermissionCode = XmlUtils.GetNodeValue(xmlFolderPermission.CreateNavigator(), "permissioncode");
         string RoleName = XmlUtils.GetNodeValue(xmlFolderPermission.CreateNavigator(), "rolename");
         bool AllowAccess = XmlUtils.GetNodeValueBoolean(xmlFolderPermission, "allowaccess");
         foreach (PermissionInfo objPermission in objPermissionController.GetPermissionByCodeAndKey(PermissionCode, PermissionKey))
         {
             PermissionID = objPermission.PermissionID;
         }
         int RoleID = int.MinValue;
         switch (RoleName)
         {
             case Globals.glbRoleAllUsersName:
                 RoleID = Convert.ToInt32(Globals.glbRoleAllUsers);
                 break;
             case Common.Globals.glbRoleUnauthUserName:
                 RoleID = Convert.ToInt32(Globals.glbRoleUnauthUser);
                 break;
             default:
                 RoleInfo objRole = objRoleController.GetRoleByName(PortalId, RoleName);
                 if (objRole != null)
                 {
                     RoleID = objRole.RoleID;
                 }
                 break;
         }
         if (RoleID != int.MinValue)
         {
             FolderPermissionInfo objFolderPermission = new FolderPermissionInfo();
             objFolderPermission.FolderID = folder.FolderID;
             objFolderPermission.PermissionID = PermissionID;
             objFolderPermission.RoleID = RoleID;
             objFolderPermission.AllowAccess = AllowAccess;
             folder.FolderPermissions.Add(objFolderPermission);
         }
     }
     FolderPermissionController.SaveFolderPermissions(folder);
 }
 public void UpdateFolder(FolderInfo objFolderInfo)
 {
     DataProvider.Instance().UpdateFolder(objFolderInfo.PortalID, objFolderInfo.FolderID, FileSystemUtils.FormatFolderPath(objFolderInfo.FolderPath), objFolderInfo.StorageLocation, objFolderInfo.IsProtected, objFolderInfo.IsCached, objFolderInfo.LastUpdated, UserController.GetCurrentUserInfo().UserID);
     Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController();
     objEventLog.AddLog(objFolderInfo, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Log.EventLog.EventLogController.EventLogType.FOLDER_UPDATED);
     DataCache.ClearFolderCache(objFolderInfo.PortalID);
 }      
 private void ParseFiles(XmlNodeList nodeFiles, int PortalId, FolderInfo objFolder)
 {
     int FileId;
     FileController objController = new FileController();
     CommonLibrary.Services.FileSystem.FileInfo objInfo;
     string fileName;
     foreach (XmlNode node in nodeFiles)
     {
         fileName = XmlUtils.GetNodeValue(node.CreateNavigator(), "filename");
         objInfo = objController.GetFile(fileName, PortalId, objFolder.FolderID);
         if (objInfo == null)
         {
             objInfo = new CommonLibrary.Services.FileSystem.FileInfo();
             objInfo.PortalId = PortalId;
             objInfo.FileName = fileName;
             objInfo.Extension = XmlUtils.GetNodeValue(node.CreateNavigator(), "extension");
             objInfo.Size = XmlUtils.GetNodeValueInt(node, "size");
             objInfo.Width = XmlUtils.GetNodeValueInt(node, "width");
             objInfo.Height = XmlUtils.GetNodeValueInt(node, "height");
             objInfo.ContentType = XmlUtils.GetNodeValue(node.CreateNavigator(), "contenttype");
             objInfo.FolderId = objFolder.FolderID;
             objInfo.Folder = objFolder.FolderPath;
             FileId = objController.AddFile(objInfo);
         }
         else
         {
             FileId = objInfo.FileId;
         }
     }
 }