Skip to content

bug(BLAZ-19123): SQL file service issue with Blazor File manager component issue has been resolved #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions Models/SQLFileProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public FileManagerResponse GetFiles(string path, bool showHiddenItems, params Fi
files.Add(childFiles);
}
reader.Close();

cwd.FilterId = GetFilterId(cwd.Id);
foreach (var file in files)
{
file.FilterId = GetFilterId(file.Id);
Expand Down Expand Up @@ -806,6 +806,7 @@ public FileManagerResponse Delete(string path, string[] names, params FileManage
Id = reader["ItemID"].ToString()
};
}
reader.Close();
}
catch (SqlException ex) { Console.WriteLine(ex.ToString()); }
finally { sqlConnection.Close(); }
Expand Down Expand Up @@ -1123,16 +1124,7 @@ public FileManagerResponse Search(string path, string searchString, bool showHid
if (path == null) { path = string.Empty; };
var searchWord = searchString;
FileManagerDirectoryContent searchData;
FileManagerDirectoryContent cwd = new FileManagerDirectoryContent();
cwd.Name = data[0].Name;
cwd.Size = data[0].Size;
cwd.IsFile = false;
cwd.DateModified = data[0].DateModified;
cwd.DateCreated = data[0].DateCreated;
cwd.HasChild = data[0].HasChild;
cwd.Type = data[0].Type;
sqlConnection.Open();
cwd.FilterPath = GetFilterPath(data[0].Id);
FileManagerDirectoryContent cwd = data[0];
sqlConnection.Close();
AccessPermission permission = GetPermission(cwd.Id, cwd.ParentID, cwd.Name, cwd.IsFile, path);
cwd.Permission = permission;
Expand Down Expand Up @@ -1263,7 +1255,7 @@ public FileManagerResponse Copy(string path, string targetPath, string[] names,
lastId = GetLastInsertedValue();
sqlConnection.Close();
sqlConnection.Open();
SqlDataReader reader = (new SqlCommand(("Select * from " + this.tableName + " where ItemID=" + item.Id), sqlConnection)).ExecuteReader();
SqlDataReader reader = (new SqlCommand(("Select * from " + this.tableName + " where ItemID=" + lastId), sqlConnection)).ExecuteReader();
while (reader.Read())
{
var copyFiles = new FileManagerDirectoryContent
Expand Down