public ActionResult History(int id) { FileListViewModel flvm = new FileListViewModel(); FileBusinessLayer fbl = new FileBusinessLayer(); List <FileDB> files = fbl.GetFiles(); List <FileViewModel> evmlist = new List <FileViewModel>(); FileDB filenow = fbl.GetFile(id); while (filenow != null) { FileViewModel fvm = new FileViewModel(); fvm.FileId = filenow.FileId; fvm.FileName = filenow.FileName; fvm.Creater = filenow.Creater; fvm.UploadTime = filenow.UploadTime; fvm.Version = filenow.Version; fvm.FileContent = filenow.FilePath; evmlist.Add(fvm); filenow = filenow.FormerId; } flvm.FileList = evmlist; flvm.Permission = Convert.ToString(Session["Permission"]); return(View("Historys", flvm)); }
// //GET: Home/Index public ActionResult Index() { FileListViewModel flvm = new FileListViewModel(); FileBusinessLayer fbl = new FileBusinessLayer(); List <FileDB> files = fbl.GetFiles(); List <FileViewModel> evmlist = new List <FileViewModel>(); foreach (FileDB file in files) { if (!file.isDelete) { FileViewModel fvm = new FileViewModel(); fvm.FileId = file.FileId; fvm.FileName = file.FileName; fvm.Creater = file.Creater; fvm.UploadTime = file.UploadTime; fvm.Version = file.Version; evmlist.Add(fvm); } } flvm.FileList = evmlist; flvm.Permission = Convert.ToString(Session["Permission"]); return(View("Index", flvm)); }
public ActionResult Index() { FileListViewModel elvm = new FileListViewModel(); FileBusinessLayer fbl = new FileBusinessLayer(); List <FileDB> files = fbl.GetFiles(); List <FileViewModel> evmlist = new List <FileViewModel>(); foreach (FileDB file in files) { if (!file.isDelete) { FileViewModel fvm = new FileViewModel(); fvm.FileId = file.FileId; fvm.FileName = file.FileName; fvm.Creater = file.Creater; fvm.UploadTime = file.UploadTime; fvm.Version = file.Version; evmlist.Add(fvm); } } elvm.FileList = evmlist; elvm.UserName = "******"; return(View("Index", elvm)); }
// //GET: /Home/SearchIndex public ActionResult SearchIndex(string keyword) { FileBusinessLayer fbl = new FileBusinessLayer(); var files = from f in fbl.GetFiles() select f; if (!String.IsNullOrEmpty(keyword)) { files = files.Where(s => s.FileName.Contains(keyword)); } return(View("SearchIndex", files)); }