Esempio n. 1
0
 public void Export_ProcessExport(HttpContext context)
 {
     if (!RequestProxry.VerifyLogin(context))
     {
         return;
     }
     ExportHandle.ProcessExport(context);
 }
Esempio n. 2
0
        public string BackCase_post(HttpContext context)
        {
            if (!RequestProxry.VerifyLogin(context))
            {
                return(null);
            }
            int  id     = int.Parse(context.Request["id"]);
            bool result = IocObject.Case.BackCase(id);

            return(JsonConvert.SerializeObject(new { result = result, message = result ? "已经驳回" : "驳回失败" }));
        }
Esempio n. 3
0
        public PluginConnectionResult Connect(IPluginApp app)
        {
            ExtendsPlugin _app=app as ExtendsPlugin;
            if(_app!=null)
            {
                RequestProxry req=new RequestProxry(_app);
                _app.Register(this,req.HandleGet,req.HandlePost);
                Cms.Plugins.MapExtendPluginRoute(this);
            }

            return PluginConnectionResult.Success;
        }
Esempio n. 4
0
        public PluginConnectionResult Connect(IPluginApp app)
        {
            ExtendsPlugin _app = app as ExtendsPlugin;

            if (_app != null)
            {
                RequestProxry req = new RequestProxry(_app);
                _app.Register(this, req.HandleGet, req.HandlePost);
                Cms.Plugins.MapExtendPluginRoute(this);
            }

            return(PluginConnectionResult.Success);
        }
Esempio n. 5
0
        public string Case_Gallery(HttpContext context)
        {
            if (!RequestProxry.VerifyLogin(context))
            {
                return(null);
            }
            int          caseId = int.Parse(context.Request["caseId"]);
            TemplatePage page   = Cms.Plugins.GetPage <Main>("admin/case_gallery.html");

            page.AddVariable("page", new PageVariable());
            page.AddVariable("case", new { Id = caseId });
            return(page.ToString());
        }
Esempio n. 6
0
        public string Export_Import(HttpContext context)
        {
            if (!RequestProxry.VerifyLogin(context))
            {
                return(null);
            }

            TemplatePage page = Cms.Plugins.GetPage <Main>("admin/export_import.html");

            page.AddVariable("page", new PageVariable());
            page.AddVariable("case", new { json = new object() });
            return(page.ToString());
        }
Esempio n. 7
0
        public string Export_Setup(HttpContext context)
        {
            if (!RequestProxry.VerifyLogin(context))
            {
                return(null);
            }

            TemplatePage page = Cms.Plugins.GetPage <Main>("admin/export_setup.html");

            page.AddVariable("page", new PageVariable());
            page.AddVariable("export", new { setup = ExportHandle.Setup(context.Request["portal"]) });
            return(page.ToString());
        }
Esempio n. 8
0
        public string Case_List(HttpContext context)
        {
            if (!RequestProxry.VerifyLogin(context))
            {
                return(null);
            }

            IocObject.Case.UpgradeCaseState();

            TemplatePage page = Cms.Plugins.GetPage <Main>("admin/case_list.html");

            page.AddVariable("page", new PageVariable());
            return(page.ToString());
        }
Esempio n. 9
0
        public void DL_Gallery2(HttpContext context)
        {
            if (!RequestProxry.VerifyLogin(context))
            {
                return;
            }

            //如果文件存在,则删除
            int    imgType = int.Parse(context.Request["imgtype"]);
            string caseIds = context.Request["caseIds"];

            byte[] bytes = this._CompressGalleryToZipForCases(imgType, caseIds);
            context.Response.BinaryWrite(bytes);
            //context.Response.AppendHeader("Content-Type","");
            context.Response.AppendHeader("Content-Disposition", "attachment;filename=" + String.Format("{0:yyyyMMddHHmmss}", DateTime.Now) + ".zip");
        }
Esempio n. 10
0
        public void DL_Gallery(HttpContext context)
        {
            //如果文件存在,则删除
            // FileInfo file = new FileInfo(workSpace + "dl/gallery.zip");

            if (!RequestProxry.VerifyLogin(context))
            {
                return;
            }

            int    caseId  = int.Parse(context.Request["caseId"]);
            int    imgType = int.Parse(context.Request["imgType"]);
            string imgIds  = context.Request["imgIds"];

            byte[] bytes = this._CompressGalleryToZip(caseId, imgType, imgIds);
            context.Response.BinaryWrite(bytes);
            //context.Response.AppendHeader("Content-Type","");
            context.Response.AppendHeader("Content-Disposition", "attachment;filename=case_" + caseId.ToString() + ".zip");
        }
Esempio n. 11
0
        public void Download(HttpContext context)
        {
            string fileName;
            string url;

            if (!RequestProxry.VerifyLogin(context))
            {
                return;
            }

            url = context.Request["url"];
            string filePath = AppDomain.CurrentDomain.BaseDirectory + url;

            if (!File.Exists(filePath))
            {
                context.Response.Write("资源不存在");
                return;
            }

            fileName = Regex.Match(url, "(\\\\|/)(([^\\\\/]+)\\.(.+))$").Groups[2].Value;
            context.Response.AppendHeader("Content-Type", "");
            context.Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileName);

            const int bufferSize = 100;

            byte[] buffer   = new byte[bufferSize];
            int    readSize = -1;

            using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read))
            {
                while (readSize != 0)
                {
                    readSize = fs.Read(buffer, 0, bufferSize);
                    context.Response.BinaryWrite(buffer);
                }
            }
        }