public ActionResult addFolder(int parentId) { int empNumber = Convert.ToInt32(User.Identity.Name); UserEmployeeModel empModel = new BLLUserAccount().GetUserByEmpNumber(empNumber); ViewData["empModel"] = empModel; BLLFolder bllFolder = new BLLFolder(); ViewData["parentFolderModel"] = bllFolder.GetFolderById(parentId); return View(); }
public ActionResult Index() { List<DocumentModel> viewdocList = new BLLDocument().getTopTenDocumentByViewNumber(); ViewData["viewTop10Doc"] = viewdocList; List<DocumentModel> dldocList = new BLLDocument().getTopTenDocumentByDownloadNumber(); ViewData["dlTop10Doc"] = dldocList; List<TagModel> tagModel = new BLLTag().getTop50TagModelList(); ViewData["tagModel"] = tagModel; BLLFolder bllFolder = new BLLFolder(); List<FolderModel> folders = (List<FolderModel>)bllFolder.GetAllFolders(); ViewData["folders"] = folders; return View(); }
public void getFilePath(string FileDownloadName) { BLLDocument bllDocument = new BLLDocument(); int docid = bllDocument.getDocumentByFileDiskName(FileDownloadName).Id; string folderPath = new BLLFolder().GetFolderById(bllDocument.getDocumentById(docid).FolderId).PhysicalPath; string fileType = FileDownloadName.Split('.')[1]; string filePath = ""; HttpContext.Response.AddHeader("content-disposition", "attachment; filename=" + FileDownloadName); if (fileType.Equals("flv")) { filePath = REPO_ROOT + folderPath + "\\" + FileDownloadName; } else { //filePath = "C:\\Users\\Margaret\\Documents\\Visual Studio 2010\\Projects\\GeekInsideKMS\\Index\\swf\\" + FileDownloadName.Split('.')[0] + ".swf"; filePath = REPO_ROOT + "swf\\" + FileDownloadName.Split('.')[0] + ".swf"; } HttpContext.Response.TransmitFile(filePath); }
// // GET: /Folder/ public JsonResult AllFolders() { BLLFolder bllFolder = new BLLFolder(); List<FolderModel> folders = (List<FolderModel>)bllFolder.GetAllFolders(); return Json(folders); }
public void getFile(int docid) { BLLDocument bllDocument = new BLLDocument(); bllDocument.DownloadNumberIncrement(docid); string FileDownloadName = bllDocument.getDocumentById(docid).FileDiskName; string FileFolderPath = new BLLFolder().GetFolderById(bllDocument.getDocumentById(docid).FolderId).PhysicalPath; HttpContext.Response.AddHeader("content-disposition", "attachment; filename=" + FileDownloadName); string filePath = REPO_ROOT + FileFolderPath + "\\" + FileDownloadName; HttpContext.Response.TransmitFile(filePath); }
//部门经理中心首页 //文件夹最多三级 public ActionResult Manager() { int empNumber = Convert.ToInt32(User.Identity.Name); BLLUserAccount bllUserAccount = new BLLUserAccount(); UserEmployeeModel empModel = new BLLUserAccount().GetUserByEmpNumber(empNumber); ViewData["empModel"] = empModel; BLLFolder bllFolder = new BLLFolder(); ViewData["outsideFolderId"] = new BLLDepartment().GetDepartment(empModel.DepartmentId).FolderId; ViewData["outsideFolderName"] = new BLLDepartment().GetDepartment(empModel.DepartmentId).DepartmentName; if (empModel.IsManager.Equals(false)) { //非部门经理 return RedirectToAction("Index", "Index"); } IList<FolderModel> folderModelList = bllFolder.getAllFoldersByDepartmentId(empModel.DepartmentId); if (folderModelList.Count() == 0) { ViewData["folderModelList"] = "nodata"; } else { ViewData["folderModelList"] = folderModelList.ToList<FolderModel>(); } return View(); }
public ActionResult doAddFolder() { FolderModel folderModel = new FolderModel(); folderModel.FolderName = Request.Form["FolderName"]; folderModel.Description = Request.Form["Description"]; folderModel.ParentFolderId = Convert.ToInt32(Request.Form["ParentFolderId"]); BLLFolder bllFolder = new BLLFolder(); if (bllFolder.addFolder(folderModel)) { TempData["successMsg"] = "添加成功。"; } else { TempData["errorMsg"] = "添加失败。"; } return RedirectToAction("Manager", "User"); }
//删除文件夹 public ActionResult deleteFolder(int folderId) { BLLFolder bllFolder = new BLLFolder(); if (bllFolder.deleteFolderById(folderId)) { TempData["successMsg"] = "删除成功。"; } else { TempData["errorMsg"] = "删除失败。"; } return RedirectToAction("Manager", "User"); }