public void Export_ProcessExport(HttpContext context) { if (!RequestProxry.VerifyLogin(context)) { return; } ExportHandle.ProcessExport(context); }
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 ? "已经驳回" : "驳回失败" })); }
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; }
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); }
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()); }
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()); }
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()); }
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()); }
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"); }
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"); }
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); } } }