using System; using System.Collections.Generic; using System.Data; using System.Text; using System.Web; using BP.DA; using BP.Sys; using BP.Web; using BP.Port; using BP.En; using BP.WF; using BP.WF.Template; using BP.Difference; using System.IO; using System.Collections; namespace BP.WF.HttpHandler { /// /// 页面功能实体 /// public class WF_TSDev2Interface : BP.WF.HttpHandler.DirectoryPageBase { #region 参数. public string Paras { get { return this.GetRequestVal("Paras"); } } #endregion /// /// 构造函数 /// public WF_TSDev2Interface() { } public string Flow_Start() { BP.WF.HttpHandler.WF_MyFlow hand = new WF_MyFlow(); return hand.MyFlow_Init(); } /// /// 创建空白的WorkID. /// /// public string Node_CreateBlankWork() { //var en = new TSEntityMyPK(); //en.ClassID = "TS.ZH.ND2001Dtl1"; //en.MyPK = "xxxx"; //en.Retrieve(); //string addr = en.GetValByKey("Tel"); string strs = this.Paras; AtPara ap = new AtPara(strs); Int64 workid = BP.WF.Dev2Interface.Node_CreateBlankWork(this.FK_Flow, ap.HisHT); return workid.ToString(); } /// /// 执行发送动作. /// /// public string Node_SendWork() { string toEmps = this.GetRequestVal("ToEmps"); return BP.WF.Dev2Interface.Node_SendWork(this.FK_Flow, this.WorkID, this.ToNodeID, toEmps).ToMsgOfText(); } public string Flow_DeleteFlow() { return BP.WF.Dev2Interface.Flow_DoDeleteFlowByReal(this.WorkID, false); } /// /// 删除草稿 /// /// public string Flow_DoDeleteDraft() { return BP.WF.Dev2Interface.Flow_DoDeleteDraft(this.FK_Flow, this.WorkID, false); } /// /// 执行退回操作 /// /// public string Node_ReturnWork() { string msg = this.GetRequestVal("Msg"); return BP.WF.Dev2Interface.Node_ReturnWork(this.WorkID, this.ToNodeID, msg, false); } public string UploadFile() { try { string fileName = this.GetRequestVal("fileName"); var files = HttpContextHelper.RequestFiles(); if (files.Count == 0) return "err@请选择要上传的文件。"; string path = BP.Difference.SystemConfig.PathOfDataUser + "UploadFile"; if (!System.IO.Directory.Exists(path)) System.IO.Directory.CreateDirectory(path); string filePath = path + "/" + fileName; string relativePath = "/DataUser/UploadFile/" + fileName; if (System.IO.File.Exists(filePath)) { System.IO.File.Delete(filePath); } //这里使用绝对路径来索引 HttpContextHelper.UploadFile(files[0], filePath); return relativePath; } catch(IOException ex) { return ex.ToString(); } } } }