public ActionResult New() { if (MvcRQ.Helpers.AccessRightsResolver.HasAdminAccess()) { ViewBag.HasAdminPermit = "true"; try { string path = "D:\\Users\\Public\\MyVLib\\My Virtual Subject Library\\"; string name = "xml/dir.xml"; RQBookmarkDAL VLD = new RQBookmarkDAL(); System.IO.DirectoryInfo VLDir = new System.IO.DirectoryInfo(path); if (VLDir.Exists) { VLD.LoadBookmarks(ref path, ref name); } else { throw new AccessViolationException("Bookmark directory does not exist!"); } } catch (Exception ex) { throw new AccessViolationException(ex.Message); } return(Json("Bookmark directory has been successfully indexed!")); } else { throw new AccessViolationException("Not authorized for this function!"); } }
public ActionResult New() { if (MvcRQ.Helpers.AccessRightsResolver.HasAdminAccess()) { ViewBag.HasAdminPermit = "true"; try { string path = "D:\\Users\\Public\\MyVLib\\My Virtual Subject Library\\"; string name = "xml/dir.xml"; RQBookmarkDAL VLD = new RQBookmarkDAL(); System.IO.DirectoryInfo VLDir = new System.IO.DirectoryInfo(path); if (VLDir.Exists) { VLD.LoadBookmarks(ref path, ref name); } else throw new AccessViolationException("Bookmark directory does not exist!"); } catch (Exception ex) { throw new AccessViolationException(ex.Message); } return Json("Bookmark directory has been successfully indexed!"); } else throw new AccessViolationException("Not authorized for this function!"); }
public string New() { string path = "D:\\Users\\Public\\MyVLib\\My Virtual Subject Library\\"; string name = "xml/dir.xml"; RQBookmarkDAL VLD = new RQBookmarkDAL(); System.IO.DirectoryInfo VLDir = new System.IO.DirectoryInfo(path); if (VLDir.Exists) { VLD.LoadBookmarks(ref path, ref name); } else throw new HttpResponseException(JsonErrorResponse.Create(System.Net.HttpStatusCode.NotFound, Mvc5RQ.Areas.DataManagement.Resources.DataManagement.dm_new_err_directory_not_found)); return Mvc5RQ.Areas.DataManagement.Resources.DataManagement.dm_new_ok; }
public string New() { string path = "D:\\Users\\Public\\MyVLib\\My Virtual Subject Library\\"; string name = "xml/dir.xml"; RQBookmarkDAL VLD = new RQBookmarkDAL(); System.IO.DirectoryInfo VLDir = new System.IO.DirectoryInfo(path); if (VLDir.Exists) { VLD.LoadBookmarks(ref path, ref name); } else { throw new HttpResponseException(JsonErrorResponse.Create(System.Net.HttpStatusCode.NotFound, Mvc5RQ.Areas.DataManagement.Resources.DataManagement.dm_new_err_directory_not_found)); } return(Mvc5RQ.Areas.DataManagement.Resources.DataManagement.dm_new_ok); }