Пример #1
0
        public JsonResult ResetAssemblies()
        {
            var srv = DocServiceFactory.CreatServices();

            MvcApplication.Assemblies = srv.SetAssemblies();
            return(Json(true, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            var docSvr = DocServiceFactory.CreatServices();

            Assemblies = docSvr.SetAssemblies();
        }
Пример #3
0
        public JsonResult AssemblyAdd(IEnumerable <HttpPostedFileBase> files)
        {
            try
            {
                var srv        = DocServiceFactory.CreatServices();
                var pathToSave = srv.DataPath;
                foreach (var file in files)
                {
                    string filename     = file.FileName;
                    int    lastSlash    = filename.LastIndexOf("\\");
                    string trailingPath = filename.Substring(lastSlash + 1);
                    string fullPath     = pathToSave + "\\" + trailingPath;

                    file.SaveAs(fullPath);
                }
                return(Json(true, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ErrorSignal.FromCurrentContext().Raise(ex);
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }