Example #1
0
        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!");
            }
        }
Example #2
0
        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!");
        }
Example #3
0
        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;
        }
Example #4
0
        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);
        }