protected override bool beforeUpdateInsertAction() { FrmAttachment workCheckAth = new FrmAttachment(); bool isHave = workCheckAth.RetrieveByAttr(FrmAttachmentAttr.MyPK, this.NodeID + "_FrmWorkCheck"); //不包含审核组件 if (isHave == false) { workCheckAth = new FrmAttachment(); /*如果没有查询到它,就有可能是没有创建.*/ workCheckAth.MyPK = this.NodeID + "_FrmWorkCheck"; workCheckAth.FK_MapData = this.NodeID.ToString(); workCheckAth.NoOfObj = this.NodeID + "_FrmWorkCheck"; workCheckAth.Exts = "*.*"; //存储路径. workCheckAth.SaveTo = "/DataUser/UploadFile/"; workCheckAth.IsNote = false; //不显示note字段. workCheckAth.IsVisable = false; // 让其在form 上不可见. //位置. workCheckAth.X = (float)94.09; workCheckAth.Y = (float)333.18; workCheckAth.W = (float)626.36; workCheckAth.H = (float)150; //多附件. workCheckAth.UploadType = AttachmentUploadType.Multi; workCheckAth.Name = "审核组件"; workCheckAth.SetValByKey("AtPara", "@IsWoEnablePageset=1@IsWoEnablePrint=1@IsWoEnableViewModel=1@IsWoEnableReadonly=0@IsWoEnableSave=1@IsWoEnableWF=1@IsWoEnableProperty=1@IsWoEnableRevise=1@IsWoEnableIntoKeepMarkModel=1@FastKeyIsEnable=0@IsWoEnableViewKeepMark=1@FastKeyGenerRole=@IsWoEnableTemplete=1"); workCheckAth.Insert(); } return(base.beforeUpdateInsertAction()); }
private void btnAttachment_Click(object sender, System.EventArgs e) { FrmAttachment dlg = new FrmAttachment(); dlg.UserId = 1; dlg.ShowDialog(); }
protected void Page_Load(object sender, EventArgs e) { #region 功能执行. if (this.DoType == "DeleteFJ") { FrmAttachment ath1 = new FrmAttachment(); ath1.MyPK = this.FK_MapData + "_" + this.Ath + "_" + this.FK_Node; ath1.Delete(); this.WinClose(); return; } if (this.DoType == "DeleteDtl") { MapDtl dtl = new MapDtl(); dtl.No = this.FK_MapDtl + "_" + this.FK_Node; dtl.Delete(); this.WinClose(); return; } #endregion 功能执行. MapData md = new MapData(this.FK_MapData); FrmField sln = new FrmField(); sln.CheckPhysicsTable(); switch (this.DoType) { case "Dtl": //附件方案. this.Title = "从表权限"; BindDtl(); break; case "FJ": //附件方案. this.Title = "表单附件权限"; BindFJ(); break; case "Field": //字段方案. this.Title = "表单字段权限"; this.BindSln(); break; case "Copy": //字段方案. this.Title = "从其它节点复制权限"; this.BindCopy(); break; case "DoCopy": //字段方案. this.Title = "执行复制权限方案"; this.DoCopy(); break; default: this.Title = "没有涉及到的类型:" + this.DoType; break; } }
protected override void afterInsertUpdateAction() { FrmAttachment ath = new FrmAttachment(); ath.MyPK = this.MyPK; ath.RetrieveFromDBSources(); ath.Update(); //调用frmEditAction, 完成其他的操作. BP.Sys.CCFormAPI.AfterFrmEditAction(this.FK_MapData); base.afterInsertUpdateAction(); }
void btn_Click(object sender, EventArgs e) { FrmAttachment ath = new FrmAttachment(); Button btn = sender as Button; if (btn.ID == "Btn_Delete") { ath.MyPK = this.FK_MapData + "_" + this.Ath; ath.Delete(); this.WinClose("删除成功."); return; } ath.MyPK = this.FK_MapData + "_" + this.Ath; if (this.Ath != null) { ath.RetrieveFromDBSources(); } ath = this.Pub1.Copy(ath) as FrmAttachment; ath.FK_MapData = this.FK_MapData; ath.MyPK = this.FK_MapData + "_" + this.Ath; GroupFields gfs1 = new GroupFields(this.FK_MapData); if (gfs1.Count == 1) { GroupField gf = (GroupField)gfs1[0]; ath.GroupID = gf.OID; } else { ath.GroupID = this.Pub1.GetDDLByID("DDL_GroupField").SelectedItemIntVal; } if (this.Ath == null) { ath.UploadType = (AttachmentUploadType)int.Parse(this.UploadType); ath.MyPK = this.FK_MapData + "_" + this.Ath; if (ath.IsExits == true) { this.Alert("附件编号(" + ath.NoOfObj + ")已经存在。"); return; } ath.Insert(); } else { ath.NoOfObj = this.Ath; ath.Update(); } this.WinCloseWithMsg("保存成功"); }
public void BindFJ() { BP.Sys.FrmAttachments fas = new BP.Sys.FrmAttachments(); fas.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData); this.Pub2.AddTable("width='100%'"); this.Pub2.AddTR(); this.Pub2.AddTDTitle("Idx"); this.Pub2.AddTDTitle("编号"); this.Pub2.AddTDTitle("名称"); this.Pub2.AddTDTitle("附件类型"); this.Pub2.AddTDTitle("原始属性"); this.Pub2.AddTDTitle("编辑"); this.Pub2.AddTDTitle("删除"); this.Pub2.AddTREnd(); int idx = 0; foreach (BP.Sys.FrmAttachment item in fas) { if (item.FK_Node != 0) { continue; } idx++; this.Pub2.AddTR(); this.Pub2.AddTDIdx(idx); this.Pub2.AddTD(item.NoOfObj); this.Pub2.AddTD(item.Name); this.Pub2.AddTD(item.UploadTypeT); this.Pub2.AddTD("<a href=\"javascript:EditFJYuanShi('" + this.FK_MapData + "','" + item.NoOfObj + "')\">原始属性</a>"); this.Pub2.AddTD("<a href=\"javascript:EditFJ('" + this.FK_Node + "','" + this.FK_MapData + "','" + item.NoOfObj + "')\">编辑</a>"); FrmAttachment en = new FrmAttachment(); en.MyPK = this.FK_MapData + "_" + item.NoOfObj + "_" + this.FK_Node; if (en.RetrieveFromDBSources() == 0) { this.Pub2.AddTD(); } else { this.Pub2.AddTD("<a href=\"javascript:DeleteFJ('" + this.FK_Node + "','" + this.FK_MapData + "','" + item.NoOfObj + "')\">删除</a>"); } this.Pub2.AddTREnd(); } this.Pub2.AddTableEnd(); }
void btn_MapAth_Click(object sender, EventArgs e) { FrmAttachment ath = new FrmAttachment(); ath.MyPK = this.FK_MapDtl + "_AthM"; if (ath.RetrieveFromDBSources() == 0) { ath.FK_MapData = this.FK_MapDtl; ath.NoOfObj = "AthM"; ath.Name = "我的从表附件"; ath.UploadType = AttachmentUploadType.Multi; ath.Insert(); } this.Response.Redirect("Attachment.aspx?DoType=Edit&FK_MapData=" + this.FK_MapDtl + "&UploadType=1&Ath=AthM", true); }
protected void Page_Load(object sender, EventArgs e) { MapData md = new MapData(this.FK_MapData); FrmAttachment athDesc = new FrmAttachment(); int i = athDesc.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData, FrmAttachmentAttr.NoOfObj, "DocMainAth"); if (i == 0) { /*如果没有数据.*/ /*如果没有查询到它,就有可能是公文多附件被删除了.*/ athDesc.NoOfObj = "DocMainAth"; athDesc.Exts = "doc,docx,xls,xlsx"; athDesc.MyPK = athDesc.FK_MapData + "_" + athDesc.NoOfObj; athDesc.FK_MapData = this.FK_MapData; //存储路径. string path = Server.MapPath("/DataUser/UploadFile/"); path += "\\F" + this.FK_Flow + "MainAth"; athDesc.SaveTo = path; //位置. athDesc.X = (float)94.09; athDesc.Y = (float)140.18; athDesc.W = (float)626.36; athDesc.H = (float)150; //多附件. athDesc.UploadType = AttachmentUploadType.Single; athDesc.Name = "公文正文(系统自动增加)"; athDesc.SetValByKey("AtPara", "@IsWoEnablePageset=1@IsWoEnablePrint=1@IsWoEnableViewModel=1@IsWoEnableReadonly=0@IsWoEnableSave=1@IsWoEnableWF=1@IsWoEnableProperty=1@IsWoEnableRevise=1@IsWoEnableIntoKeepMarkModel=1@FastKeyIsEnable=0@IsWoEnableViewKeepMark=1@FastKeyGenerRole=@IsWoEnableTemplete=1"); athDesc.Insert(); //有可能在其其它的节点上没有这个附件,所以也要循环增加上它. BP.WF.Nodes nds = new Nodes(this.FK_Flow); foreach (Node nd in nds) { athDesc.FK_MapData = "ND" + nd.NodeID; athDesc.MyPK = athDesc.FK_MapData + "_" + athDesc.NoOfObj; if (athDesc.IsExits == true) { continue; } athDesc.Insert(); } //重新查询一次,把默认值加上. athDesc.RetrieveFromDBSources(); } FrmAttachmentDBs athDBs = null; athDBs = new FrmAttachmentDBs(this.FK_MapData, this.WorkID.ToString()); FrmAttachmentDB athDB = null; if (athDBs.Count == 0 && this.IsCC == "1") { /*如果是抄送过来的, 有可能是抄送到的节点不是发送到的节点,导致附件数据没有copy。 * 也就是说,发给b节点,但是抄送到c节点上去了,导致c节点上的人看不到附件数据。*/ CCList cc = new CCList(); int nnn = cc.Retrieve(CCListAttr.FK_Node, this.FK_Node, CCListAttr.WorkID, this.WorkID, CCListAttr.CCTo, WebUser.No); this._fk_node = cc.NDFrom; if (cc.NDFrom != 0) { athDBs.Retrieve(FrmAttachmentDBAttr.FK_MapData, "ND" + cc.NDFrom, FrmAttachmentDBAttr.RefPKVal, this.WorkID.ToString()); string ndFromMapdata = athDesc.MyPK.Replace(athDesc.FK_MapData, "ND" + cc.NDFrom); athDB = athDBs.GetEntityByKey(FrmAttachmentDBAttr.FK_FrmAttachment, ndFromMapdata) as FrmAttachmentDB; //重新设置文件描述。 athDesc.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData, FrmAttachmentAttr.NoOfObj, "DocMainAth"); } } else { /* 单个文件 */ athDB = athDBs.GetEntityByKey(FrmAttachmentDBAttr.FK_FrmAttachment, athDesc.MyPK) as FrmAttachmentDB; } Label lab = new Label(); lab.ID = "Lab" + athDesc.MyPK; this.Pub1.Add(lab); if (athDB != null) { if (athDB.FileExts == "ceb") { athDB.FileExts = "pdf"; } if (athDesc.IsWoEnableWF) { lab.Text = "<a href=\"javascript:OpenOfiice('" + athDB.FK_FrmAttachment + "','" + this.WorkID + "','" + athDB.MyPK + "','" + this.FK_MapData + "','" + athDesc.NoOfObj + "','" + this.FK_Node + "')\"><img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/FileType/" + athDB.FileExts + ".gif' border=0/>" + athDB.FileName + "</a>"; } else { lab.Text = "<img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/FileType/" + athDB.FileExts + ".gif' border=0/>" + athDB.FileName; } } #region 处理权限问题. // 处理权限问题, 有可能当前节点是可以上传或者删除,但是当前节点上不能让此人执行工作。 bool isDel = athDesc.IsDeleteInt == 0 ? false : true; bool isUpdate = athDesc.IsUpload; if (isDel == true || isUpdate == true) { if (this.WorkID != 0 && string.IsNullOrEmpty(this.FK_Flow) == false) { isDel = BP.WF.Dev2Interface.Flow_IsCanDoCurrentWork(this.FK_Flow, this.FK_Node, this.WorkID, WebUser.No); if (isDel == false) { isUpdate = false; } } } #endregion 处理权限问题. Button mybtn = new Button(); mybtn.CssClass = "Btn"; if (athDesc.IsUpload && isUpdate == true) { FileUpload fu = new FileUpload(); fu.ID = athDesc.MyPK; Btn_Upload.ID = "Btn_Upload_" + athDesc.MyPK + "_" + this.WorkID; fu.Attributes["Width"] = athDesc.W.ToString(); fu.Attributes["onchange"] = "UploadChange('" + mybtn.ID + "');"; this.Pub1.Add(fu); } if (athDesc.IsDownload) { mybtn = new Button(); mybtn.Text = "下载"; mybtn.CssClass = "Btn"; mybtn.ID = "Btn_Download_" + athDesc.MyPK + "_" + this.WorkID; mybtn.Click += new EventHandler(btnUpload_Click); mybtn.CssClass = "bg"; if (athDB == null) { mybtn.Visible = false; } else { mybtn.Visible = true; } this.Pub1.Add(mybtn); } if (this.IsReadonly == false) { if (athDesc.IsDeleteInt != 0 && isDel == true) { bool isDeleteBtn = true; if (athDesc.IsDeleteInt == 2) { if (!athDB.Rec.Equals(WebUser.No)) { isDeleteBtn = false; } } if (isDeleteBtn) { mybtn = new Button(); mybtn.CssClass = "Btn"; mybtn.Text = "删除"; mybtn.Attributes["onclick"] = " return confirm('您确定要执行删除吗?');"; mybtn.ID = "Btn_Delete_" + athDesc.MyPK + "_" + this.WorkID; mybtn.Click += new EventHandler(btnUpload_Click); mybtn.CssClass = "bg"; if (athDB == null) { mybtn.Visible = false; } else { mybtn.Visible = true; } this.Pub1.Add(mybtn); } } if (athDesc.IsWoEnableWF) { mybtn = new Button(); mybtn.CssClass = "Btn"; mybtn.Text = "打开"; mybtn.ID = "Btn_Open_" + athDesc.MyPK + "_" + this.WorkID; mybtn.Click += new EventHandler(btnUpload_Click); mybtn.CssClass = "bg"; if (athDB == null) { mybtn.Visible = false; } else { mybtn.Visible = true; } this.Pub1.Add(mybtn); } } }
protected void btnUpload_Click(object sender, EventArgs e) { Button btn = sender as Button; string[] ids = btn.ID.Split('_'); //string athPK = ids[2] + "_" + ids[3] ; string doType = ids[1]; string athPK = btn.ID.Replace("Btn_" + doType + "_", ""); athPK = athPK.Substring(0, athPK.LastIndexOf('_')); string athDBPK = athPK + "_" + this.WorkID; FrmAttachment frmAth = new FrmAttachment(); frmAth.MyPK = athPK; frmAth.RetrieveFromDBSources(); string pkVal = this.WorkID.ToString(); switch (doType) { case "Delete": FrmAttachmentDB db = new FrmAttachmentDB(); db.MyPK = athDBPK; db.Delete(); try { Button btnDel = this.Pub1.GetButtonByID("Btn_Delete_" + athDBPK); btnDel.Visible = false; btnDel = this.Pub1.GetButtonByID("Btn_Download_" + athDBPK); btnDel.Visible = false; btnDel = this.Pub1.GetButtonByID("Btn_Open_" + athDBPK); btnDel.Visible = false; } catch { } Label lab1 = this.Pub1.GetLabelByID("Lab" + frmAth.MyPK); lab1.Text = ""; break; case "Upload": FileUpload fu = this.Pub1.FindControl(athPK) as FileUpload; if (fu.HasFile == false || fu.FileName.Length <= 2) { BP.Sys.PubClass.Alert("请选择上传的文件"); return; } //检查格式是否符合要求. if (frmAth.Exts == "" || frmAth.Exts == "*.*") { /*任何格式都可以上传.*/ } else { string fileExt = fu.FileName.Substring(fu.FileName.LastIndexOf('.') + 1); fileExt = fileExt.ToLower().Replace(".", ""); if (frmAth.Exts.ToLower().Contains(fileExt) == false) { BP.Sys.PubClass.Alert("您上传的文件格式不符合要求,要求格式为:" + frmAth.Exts); return; } } //处理保存路径. string saveTo = frmAth.SaveTo; if (saveTo.Contains("*") || saveTo.Contains("@")) { /*如果路径里有变量.*/ saveTo = saveTo.Replace("*", "@"); saveTo = BP.WF.Glo.DealExp(saveTo, null, null); } try { saveTo = Server.MapPath("~/" + saveTo); } catch { //saveTo = saveTo; } if (System.IO.Directory.Exists(saveTo) == false) { System.IO.Directory.CreateDirectory(saveTo); } saveTo = saveTo + "\\" + athDBPK + "." + fu.FileName.Substring(fu.FileName.LastIndexOf('.') + 1); fu.SaveAs(saveTo); FileInfo info = new FileInfo(saveTo); FrmAttachmentDB dbUpload = new FrmAttachmentDB(); dbUpload.MyPK = athDBPK; dbUpload.FK_FrmAttachment = athPK; dbUpload.RefPKVal = this.WorkID.ToString(); if (this.EnName == null) { dbUpload.FK_MapData = this.FK_MapData; } else { dbUpload.FK_MapData = this.EnName; } dbUpload.FileExts = info.Extension; dbUpload.FileFullName = saveTo; dbUpload.FileName = fu.FileName; dbUpload.FileSize = (float)info.Length; dbUpload.Rec = WebUser.No; dbUpload.RecName = WebUser.Name; dbUpload.RDT = BP.DA.DataType.CurrentDataTime; if (this.Request.QueryString["FK_Node"] != null) { dbUpload.NodeID = this.Request.QueryString["FK_Node"]; } dbUpload.Save(); Button myBtnDel = this.Pub1.GetButtonByID("Btn_Delete_" + athDBPK); if (myBtnDel != null) { myBtnDel.Visible = true; myBtnDel = this.Pub1.GetButtonByID("Btn_Download_" + athDBPK); myBtnDel.Visible = true; } Button myBtnOpen = this.Pub1.GetButtonByID("Btn_Open_" + athDBPK); if (myBtnOpen != null) { myBtnOpen.Visible = true; myBtnOpen = this.Pub1.GetButtonByID("Btn_Download_" + athDBPK); myBtnOpen.Visible = true; } Label lab = this.Pub1.GetLabelByID("Lab" + frmAth.MyPK); if (lab != null) { if (frmAth.IsWoEnableWF) { if (dbUpload.FileExts.ToUpper().Equals("CEB")) { lab.Text = "<a href=\"javascript:OpenOfiice('" + dbUpload.FK_FrmAttachment + "','" + this.WorkID + "','" + dbUpload.MyPK + "','" + this.FK_MapData + "','" + frmAth.NoOfObj + "','" + this.FK_Node + "')\"><img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/FileType/pdf.gif' border=0/>" + dbUpload.FileName + "</a>"; } else { lab.Text = "<a href=\"javascript:OpenOfiice('" + dbUpload.FK_FrmAttachment + "','" + this.WorkID + "','" + dbUpload.MyPK + "','" + this.FK_MapData + "','" + frmAth.NoOfObj + "','" + this.FK_Node + "')\"><img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/FileType/" + dbUpload.FileExts + ".gif' border=0/>" + dbUpload.FileName + "</a>"; } } else { if (dbUpload.FileExts.ToUpper().Equals("CEB")) { lab.Text = "<a href=\"javascript:OpenFileView('" + this.WorkID + "','" + dbUpload.MyPK + "')\"><img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/FileType/pdf.gif' border=0/>" + dbUpload.FileName + "</a>"; } else { lab.Text = "<img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/FileType/" + dbUpload.FileExts + ".gif' border=0/>" + dbUpload.FileName; } } //lab.Text = "<img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/FileType/" + dbUpload.FileExts + ".gif' alt='" + dbUpload.FileName + "' ID='" + frmAth.NoOfObj + "' border=0/>" + dbUpload.FileName; } return; case "Download": FrmAttachmentDB dbDown = new FrmAttachmentDB(); dbDown.MyPK = athDBPK; if (dbDown.RetrieveFromDBSources() == 0) { dbDown.Retrieve(FrmAttachmentDBAttr.FK_MapData, this.FK_MapData, FrmAttachmentDBAttr.RefPKVal, this.WorkID, FrmAttachmentDBAttr.FK_FrmAttachment, frmAth.FK_MapData + "_" + frmAth.NoOfObj); } string downPath = GetRealPath(dbDown.FileFullName); PubClass.DownloadFile(dbDown.FileFullName, dbDown.FileName); break; case "Open": var url = BP.WF.Glo.CCFlowAppPath + "WF/WebOffice/AttachOffice.aspx?DoType=EditOffice&DelPKVal=" + athDBPK + "&FK_FrmAttachment=" + frmAth.MyPK + "&PKVal=" + this.WorkID + "&FK_Node=" + this.FK_Node + "&FK_MapData=" + frmAth.FK_MapData + "&NoOfObj=" + frmAth.NoOfObj; PubClass.WinOpen(url, "WebOffice编辑", 850, 600); break; default: break; } }
protected void Page_Load(object sender, EventArgs e) { FrmAttachment ath = new FrmAttachment(); ath.FK_MapData = this.FK_MapData; ath.NoOfObj = this.Ath; ath.FK_Node = this.FK_Node; if (this.FK_Node == 0) { ath.MyPK = this.FK_MapData + "_" + this.Ath; } else { ath.MyPK = this.FK_MapData + "_" + this.Ath + "_" + this.FK_Node; } int i = ath.RetrieveFromDBSources(); if (i == 0 && this.FK_Node != 0) { /*这里处理 独立表单解决方案, 如果有FK_Node 就说明该节点需要单独控制该附件的属性. */ MapData mapData = new MapData(); mapData.RetrieveByAttr(MapDataAttr.No, this.FK_MapData); if (mapData.AppType == "0") { FrmAttachment souceAthMent = new FrmAttachment(); // 查询出来原来的数据. int rowCount = souceAthMent.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData, FrmAttachmentAttr.NoOfObj, this.Ath, FrmAttachmentAttr.FK_Node, "0"); if (rowCount > 0) { ath.Copy(souceAthMent); } } if (this.FK_Node == 0) { ath.MyPK = this.FK_MapData + "_" + this.Ath; } else { ath.MyPK = this.FK_MapData + "_" + this.Ath + "_" + this.FK_Node; } //插入一个新的. ath.FK_Node = this.FK_Node; ath.FK_MapData = this.FK_MapData; ath.NoOfObj = this.Ath; ath.DirectInsert(); } #region 基本属性. this.Title = "附件属性设置"; this.Pub1.AddTable(); this.Pub1.AddCaption("附件属性设置"); int idx = 0; this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTDTitle("colspan=3", "基本属性"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("编号"); TextBox tb = new TextBox(); tb.ID = "TB_" + FrmAttachmentAttr.NoOfObj; tb.Text = ath.NoOfObj; if (this.Ath != null) { tb.Enabled = false; } this.Pub1.AddTD(tb); this.Pub1.AddTD("标示号只能英文字母数字或下滑线."); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("名称"); tb = new TextBox(); tb.ID = "TB_" + FrmAttachmentAttr.Name; tb.Text = ath.Name; this.Pub1.AddTD(tb); this.Pub1.AddTD("附件的中文名称."); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("文件格式"); tb = new TextBox(); tb.ID = "TB_" + FrmAttachmentAttr.Exts; tb.Text = ath.Exts; this.Pub1.AddTD(tb); this.Pub1.AddTD("实例:doc,docx,xls,多种格式用逗号分开."); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("文件数据存储方式"); DDL ddl = new DDL(); ddl.ID = "DDL_" + FrmAttachmentAttr.SaveWay; ddl.Items.Add(new ListItem("按文件方式保存", "0")); ddl.Items.Add(new ListItem("保存到数据库", "1")); ddl.SetSelectItem(ath.SaveWay); this.Pub1.AddTD(ddl); this.Pub1.AddTD("上传的附件如何保存?"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("保存到"); tb = new TextBox(); tb.ID = "TB_" + FrmAttachmentAttr.SaveTo; tb.Text = ath.SaveTo; tb.Columns = 60; this.Pub1.AddTD("colspan=2", "文件存储格式才有意义", tb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("类别"); tb = new TextBox(); tb.ID = "TB_" + FrmAttachmentAttr.Sort; tb.Text = ath.Sort; tb.Columns = 60; this.Pub1.AddTD("colspan=2", tb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("colspan=3", "帮助:类别可以为空,设置的格式为:列头显示名称@类别名1,类别名2,类别名3(列头显示名称@ :可以不写,默认为:类别)"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("完整性校验"); // BP.Web.Controls.DDL ddl=new DDL(); ddl = new DDL(); ddl.ID = "DDL_UploadFileNumCheck"; ddl.BindSysEnum("UploadFileCheck", (int)ath.UploadFileNumCheck); this.Pub1.AddTD("colspan=2", ddl); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("高度"); BP.Web.Controls.TB mytb = new BP.Web.Controls.TB(); mytb.ID = "TB_" + FrmAttachmentAttr.H; mytb.Text = ath.H.ToString(); mytb.ShowType = BP.Web.Controls.TBType.Float; this.Pub1.AddTD("colspan=1", mytb); this.Pub1.AddTD("对傻瓜表单有效"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("宽度"); mytb = new BP.Web.Controls.TB(); mytb.ID = "TB_" + FrmAttachmentAttr.W; mytb.Text = ath.W.ToString(); mytb.ShowType = BP.Web.Controls.TBType.Float; mytb.Columns = 60; this.Pub1.AddTD("colspan=1", mytb); this.Pub1.AddTD("对傻瓜表单有效"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("自动控制"); CheckBox cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsAutoSize; cb.Text = "自动控制高度与宽度(对傻瓜表单有效)"; cb.Checked = ath.IsAutoSize; this.Pub1.AddTD("colspan=2", cb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsNote; cb.Text = "是否增加备注列"; cb.Checked = ath.IsNote; this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsShowTitle; cb.Text = "是否显示标题列"; cb.Checked = ath.IsShowTitle; this.Pub1.AddTD(cb); this.Pub1.AddTD(""); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsVisable; cb.Text = "是否可见(不打勾就隐藏,隐藏后就显示不到表单上,可以显示在组件里.)"; cb.Checked = ath.IsVisable; this.Pub1.AddTD("colspan=3", cb); this.Pub1.AddTREnd(); GroupFields gfs = new GroupFields(ath.FK_MapData); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("显示在分组"); ddl = new BP.Web.Controls.DDL(); ddl.ID = "DDL_GroupField"; ddl.BindEntities(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab, false, BP.Web.Controls.AddAllLocation.None); ddl.SetSelectItem(ath.GroupID); this.Pub1.AddTD("colspan=1", ddl); this.Pub1.AddTD("对傻瓜表单有效"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("展现方式"); ddl = new BP.Web.Controls.DDL(); ddl.ID = "DDL_" + FrmAttachmentAttr.FileShowWay; ddl.Items.Clear(); ddl.Items.Add(new ListItem("Table方式", "0")); ddl.Items.Add(new ListItem("图片轮播方式", "1")); ddl.Items.Add(new ListItem("自由模式", "2")); ddl.SelectedValue = Convert.ToString((int)ath.FileShowWay); this.Pub1.AddTD("colspan=2", ddl); this.Pub1.AddTREnd(); #endregion 基本属性. #region 权限控制. this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTDTitle("colspan=3", "权限控制" + BP.WF.Glo.GenerHelpCCForm("帮助", null, null)); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsDownload; cb.Text = "是否可下载"; cb.Checked = ath.IsDownload; this.Pub1.AddTD(cb); ddl = new BP.Web.Controls.DDL(); ddl.ID = "DDL_" + FrmAttachmentAttr.IsDelete; ddl.Items.Clear(); ddl.Items.Add(new ListItem("不能删除", "0")); ddl.Items.Add(new ListItem("删除所有", "1")); ddl.Items.Add(new ListItem("只能删除自己上传的", "2")); ddl.SetSelectItem(ath.IsDeleteInt); this.Pub1.AddTD(ddl); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsUpload; cb.Text = "是否可上传"; cb.Checked = ath.IsUpload; this.Pub1.AddTD(cb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsOrder; cb.Text = "是否可以排序"; cb.Checked = ath.IsOrder; this.Pub1.AddTD(cb); this.Pub1.AddTD("使用上传控件方式"); ddl = new BP.Web.Controls.DDL(); ddl.ID = "DDL_" + FrmAttachmentAttr.UploadCtrl; ddl.Items.Clear(); ddl.Items.Add(new ListItem("批量上传", "0")); ddl.Items.Add(new ListItem("普通上传", "1")); ddl.SetSelectItem(ath.UploadCtrl); this.Pub1.AddTD(ddl); this.Pub1.AddTREnd(); if (ath.IsNodeSheet == true) { this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("数据显示控制方式"); ddl = new BP.Web.Controls.DDL(); ddl.ID = "DDL_CtrlWay"; ddl.Items.Clear(); ddl.Items.Add(new ListItem("按主键", "0")); ddl.Items.Add(new ListItem("FID", "1")); ddl.Items.Add(new ListItem("ParentWorkID", "2")); ddl.Items.Add(new ListItem("仅可以查看自己上传数据", "3")); ddl.SetSelectItem((int)ath.HisCtrlWay); this.Pub1.AddTD("colspan=2", ddl); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("子线程节点控制(对节点表单有效)"); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsToHeLiuHZ; cb.Text = "该附件是否要汇总到合流节点上去?(对子线程节点有效)"; cb.Checked = ath.IsToHeLiuHZ; this.Pub1.AddTD("colspan=2", cb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("合流节点控制(对节点表单有效)"); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsHeLiuHuiZong; cb.Text = "是否是合流节点的汇总附件组件?(对合流节点有效)"; cb.Checked = ath.IsHeLiuHuiZong; this.Pub1.AddTD("colspan=2", cb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("数据上传控制方式"); ddl = new BP.Web.Controls.DDL(); ddl.ID = "DDL_AthUploadWay"; ddl.Items.Clear(); ddl.Items.Add(new ListItem("继承模式", "0")); ddl.Items.Add(new ListItem("协作模式", "1")); ddl.SetSelectItem((int)ath.AthUploadWay); this.Pub1.AddTD("colspan=2", ddl); this.Pub1.AddTREnd(); this.Pub1.AddTREnd(); } #endregion 权限控制. #region WebOffice控制方式. this.Pub1.AddTR1(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTDTitle("colspan=3", "WebOffice控制方式(如果上传的是excel word附件,在打开的时候对其的控制)."); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableWF; cb.Text = "是否启用weboffice?"; cb.Checked = ath.IsWoEnableWF; this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableSave; cb.Text = "是否启用保存?"; cb.Checked = ath.IsWoEnableSave; this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableReadonly; cb.Text = "是否只读?"; cb.Checked = ath.IsWoEnableReadonly; this.Pub1.AddTD(cb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableRevise; cb.Text = "是否启用修订?"; cb.Checked = ath.IsWoEnableRevise; this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableViewKeepMark; cb.Text = "是否查看用户留痕?"; cb.Checked = ath.IsWoEnableViewKeepMark; this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnablePrint; cb.Text = "是否打印?"; cb.Checked = ath.IsWoEnablePrint; this.Pub1.AddTD(cb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableOver; cb.Text = "是否启用套红?"; cb.Checked = ath.IsWoEnableOver; this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableSeal; cb.Text = "是否启用签章?"; cb.Checked = ath.IsWoEnableSeal; this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableTemplete; cb.Text = "是否启用模板文件?"; cb.Checked = ath.IsWoEnableTemplete; this.Pub1.AddTD(cb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableCheck; cb.Text = "是否记录节点信息?"; cb.Checked = ath.IsWoEnableCheck; this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableInsertFlow; cb.Text = "是否启用插入流程?"; cb.Checked = ath.IsWoEnableInsertFlow; this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableInsertFengXian; cb.Text = "是否启用插入风险点?"; cb.Checked = ath.IsWoEnableInsertFengXian; this.Pub1.AddTD(cb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableMarks; cb.Text = "是否进入留痕模式?"; cb.Checked = ath.IsWoEnableMarks; this.Pub1.AddTD(cb); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsWoEnableDown; cb.Text = "是否启用下载?"; cb.Checked = ath.IsWoEnableDown; this.Pub1.AddTD(cb); this.Pub1.AddTD(""); this.Pub1.AddTREnd(); this.Pub1.AddTREnd(); #endregion WebOffice控制方式. #region 快捷键生成规则. this.Pub1.AddTR1(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTDTitle("colspan=3", "快捷键生成规则."); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.FastKeyIsEnable; cb.Text = "是否启用生成快捷键?(启用就会按照规则生成放在附件的同一个目录里面)"; cb.Checked = ath.FastKeyIsEnable; this.Pub1.AddTD("colspan=3", cb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); tb = new BP.Web.Controls.TB(); tb.ID = "TB_" + FrmAttachmentAttr.FastKeyGenerRole; tb.Text = ath.FastKeyGenerRole; tb.Columns = 30; this.Pub1.AddTD("colspan=3", tb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD("colspan=3", "格式:*FiledName.*OID"); this.Pub1.AddTREnd(); #endregion 快捷键生成规则. #region 保存按钮. this.Pub1.AddTR(); this.Pub1.AddTDIdx(idx++); this.Pub1.AddTD(""); Button btn = new Button(); btn.ID = "Btn_Save"; btn.Text = " Save "; btn.CssClass = "Btn"; btn.Click += new EventHandler(btn_Click); this.Pub1.AddTD(btn); if (this.Ath != null) { btn = new Button(); btn.ID = "Btn_Delete"; btn.Text = " Delete "; btn.CssClass = "Btn"; btn.Attributes["onclick"] = " return confirm('您确认吗?');"; btn.Click += new EventHandler(btn_Click); this.Pub1.AddTD(btn); } else { this.Pub1.AddTD(); } this.Pub1.AddTREnd(); #endregion 保存按钮. this.Pub1.AddTableEnd(); }
void btn_Click(object sender, EventArgs e) { FrmAttachment ath = new FrmAttachment(); if (this.FK_Node == 0) { ath.MyPK = this.FK_MapData + "_" + this.Ath; } else { ath.MyPK = this.FK_MapData + "_" + this.Ath + "_" + this.FK_Node; } ath.RetrieveFromDBSources(); Button btn = sender as Button; if (btn.ID == "Btn_Delete") { //ath.MyPK = this.FK_MapData + "_" + this.Ath; ath.Delete(); this.WinClose("删除成功."); return; } ath.MyPK = this.FK_MapData + "_" + this.Ath; if (this.Ath != null) { ath.RetrieveFromDBSources(); } ath = this.Pub1.Copy(ath) as FrmAttachment; ath.FK_MapData = this.FK_MapData; ath.FK_Node = this.FK_Node; if (string.IsNullOrEmpty(this.Ath) == false) { ath.NoOfObj = this.Ath; } if (this.FK_Node == 0) { ath.MyPK = this.FK_MapData + "_" + ath.NoOfObj; } else { ath.MyPK = this.FK_MapData + "_" + ath.NoOfObj + "_" + this.FK_Node; } GroupFields gfs1 = new GroupFields(this.FK_MapData); if (gfs1.Count == 1) { GroupField gf = (GroupField)gfs1[0]; ath.GroupID = gf.OID; } else { ath.GroupID = this.Pub1.GetDDLByID("DDL_GroupField").SelectedItemIntVal; } //对流程的特殊判断. 20160513 加载页面时添加了判断,此处没有添加,导致保存报错。 zqp if (ath.IsNodeSheet == true) { ath.HisCtrlWay = (AthCtrlWay)this.Pub1.GetDDLByID("DDL_CtrlWay").SelectedItemIntVal; ath.AthUploadWay = (AthUploadWay)this.Pub1.GetDDLByID("DDL_AthUploadWay").SelectedItemIntVal; ath.FileShowWay = (FileShowWay)this.Pub1.GetDDLByID("DDL_FileShowWay").SelectedItemIntVal; //文件展现方式. ath.UploadCtrl = this.Pub1.GetDDLByID("DDL_UploadCtrl").SelectedItemIntVal; //使用的附件上传工具. ath.SaveWay = this.Pub1.GetDDLByID("DDL_" + FrmAttachmentAttr.SaveWay).SelectedItemIntVal; //保存方式. ath.IsHeLiuHuiZong = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsHeLiuHuiZong).Checked; //是否是合流节点汇总. ath.IsToHeLiuHZ = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsToHeLiuHZ).Checked; //是否汇总到合流节点.. } //word附件相关. ath.IsWoEnableWF = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableWF).Checked; ath.IsWoEnableSave = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableSave).Checked; ath.IsWoEnableReadonly = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableReadonly).Checked; ath.IsWoEnableRevise = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableRevise).Checked; ath.IsWoEnableViewKeepMark = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableViewKeepMark).Checked; ath.IsWoEnablePrint = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnablePrint).Checked; ath.IsWoEnableSeal = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableSeal).Checked; ath.IsWoEnableOver = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableOver).Checked; ath.IsWoEnableTemplete = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableTemplete).Checked; ath.IsWoEnableCheck = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableCheck).Checked; ath.IsWoEnableInsertFengXian = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableInsertFengXian).Checked; ath.IsWoEnableInsertFlow = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableInsertFlow).Checked; ath.IsWoEnableMarks = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableMarks).Checked; ath.IsWoEnableDown = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsWoEnableDown).Checked; ath.IsVisable = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsVisable).Checked; //是否可见. ath.FastKeyIsEnable = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.FastKeyIsEnable).Checked; ath.FastKeyGenerRole = this.Pub1.GetTBByID("TB_" + FrmAttachmentAttr.FastKeyGenerRole).Text; ath.IsOrder = this.Pub1.GetCBByID("CB_" + FrmAttachmentAttr.IsOrder).Checked; if (ath.FastKeyIsEnable == true) { if (ath.FastKeyGenerRole.Contains("*OID") == false) { throw new Exception("@快捷键生成规则必须包含*OID,否则会导致文件名重复."); } } if (this.Ath == null) { ath.UploadType = (AttachmentUploadType)int.Parse(this.UploadType); if (this.FK_Node == 0) { ath.MyPK = this.FK_MapData + "_" + ath.NoOfObj; } else { ath.MyPK = this.FK_MapData + "_" + ath.NoOfObj + "_" + this.FK_Node; } if (ath.IsExits == true) { this.Alert("附件编号(" + ath.NoOfObj + ")已经存在。"); return; } ath.Insert(); } else { ath.NoOfObj = this.Ath; if (this.FK_Node == 0) { ath.MyPK = this.FK_MapData + "_" + this.Ath; } else { ath.MyPK = this.FK_MapData + "_" + this.Ath + "_" + this.FK_Node; } ath.Update(); } this.WinCloseWithMsg("保存成功"); }
void btn_Click(object sender, EventArgs e) { Button btn = sender as Button; try { switch (this.DoType) { case "New": default: MapDtl dtlN = new MapDtl(); dtlN = (MapDtl)this.Pub1.Copy(dtlN); try { dtlN.GroupField = this.Pub1.GetDDLByID("DDL_GroupField").SelectedItemStringVal; } catch { } if (this.DoType == "New") { if (dtlN.IsExits) { this.Alert("已存在编号:" + dtlN.No); return; } } dtlN.FK_MapData = this.FK_MapData; dtlN.GroupID = 0; dtlN.RowIdx = 0; // 参数属性. dtlN.DtlSaveModel = (DtlSaveModel)this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.DtlSaveModel).SelectedItemIntVal; dtlN.DtlAddRecModel = (DtlAddRecModel)this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.DtlAddRecModel).SelectedItemIntVal; GroupFields gfs1 = new GroupFields(this.FK_MapData); if (gfs1.Count == 1) { GroupField gf = (GroupField)gfs1[0]; dtlN.GroupID = gf.OID; } else { dtlN.GroupID = this.Pub1.GetDDLByID("DDL_GroupID").SelectedItemIntVal; } dtlN.Insert(); if (btn.ID.Contains("AndClose")) { this.WinClose(); return; } this.Response.Redirect("MapDtl.aspx?DoType=Edit&FK_MapDtl=" + dtlN.No + "&FK_MapData=" + this.FK_MapData, true); break; case "Edit": MapDtl dtl = new MapDtl(this.FK_MapDtl); dtl = (MapDtl)this.Pub1.Copy(dtl); //参数保存. dtl.IsEnableLink = this.Pub1.GetCBByID("CB_" + MapDtlAttr.IsEnableLink).Checked; //手动保存,added by liuxc,2016-4-7 dtl.DtlSaveModel = (DtlSaveModel)this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.DtlSaveModel).SelectedItemIntVal; dtl.DtlAddRecModel = (DtlAddRecModel)this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.DtlAddRecModel).SelectedItemIntVal; if (this.FK_Node != 0) { //是否是分流. add 2015-06-30. dtl.IsFLDtl = this.Pub1.GetCBByID("CB_" + MapDtlAttr.IsFLDtl).Checked; //子线程处理字段. if (this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.SubThreadGroupMark).Items.Count > 0) { dtl.SubThreadGroupMark = this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.SubThreadGroupMark).SelectedItemStringVal; } if (this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.SubThreadWorker).Items.Count > 0) { dtl.SubThreadWorker = this.Pub1.GetDDLByID("DDL_" + MapDtlAttr.SubThreadWorker).SelectedItemStringVal; } } dtl.LinkLabel = this.Pub1.GetTBByID("TB_" + MapDtlAttr.LinkLabel).Text; dtl.LinkTarget = this.Pub1.GetTBByID("TB_" + MapDtlAttr.LinkTarget).Text; dtl.LinkUrl = this.Pub1.GetTBByID("TB_" + MapDtlAttr.LinkUrl).Text; //锁定. dtl.IsRowLock = this.Pub1.GetCBByID("CB_" + MapDtlAttr.IsRowLock).Checked; //分组字段。 try { dtl.GroupField = this.Pub1.GetDDLByID("DDL_GroupField").SelectedItemStringVal; } catch { } if (this.DoType == "New") { if (dtl.IsExits) { this.Alert("已存在编号:" + dtl.No); return; } } dtl.FK_MapData = this.FK_MapData; GroupFields gfs = new GroupFields(dtl.FK_MapData); if (gfs.Count > 1) { dtl.GroupID = this.Pub1.GetDDLByID("DDL_GroupID").SelectedItemIntVal; } if (dtl.IsEnableAthM) { /*如果启用了多附件.*/ FrmAttachment ath = new FrmAttachment(); ath.MyPK = dtl.No + "_AthMDtl"; ath.FK_MapData = dtl.No; ath.NoOfObj = "AthMDtl"; ath.Name = "从表行记录附件"; if (ath.RetrieveFromDBSources() == 0) { ath.Insert(); } } if (this.DoType == "New") { dtl.Insert(); } else { dtl.Update(); } if (btn.ID.Contains("AndC")) { this.WinClose(); return; } this.Response.Redirect("MapDtl.aspx?DoType=Edit&FK_MapDtl=" + dtl.No + "&FK_MapData=" + this.FK_MapData, true); break; } } catch (Exception ex) { this.Alert(ex.Message); } }
private void AddFileUpload(bool isUpdate, FrmAttachment athDesc) { if (isUpdate == true && this.IsReadonly != "1") { this.Pub1.AddTR(); if (athDesc.IsNote) { this.Pub1.AddTDBegin("colspan=8"); } else { this.Pub1.AddTDBegin("colspan=7"); } #region 增加大附件上传 //加载js方法 if (CheckBrowserIsIE()) { string fileExts = athDesc.Exts.Replace("|", ";"); fileExts = athDesc.Exts.Replace(",", ";"); string realFileExts = ""; string[] fileExtData = fileExts.Split(';'); foreach (string ext in fileExtData) { if (!string.IsNullOrEmpty(ext)) { if (ext.StartsWith("*.")) { realFileExts += ext + ";"; } else { realFileExts += "*." + ext + ";"; } } } if (string.IsNullOrEmpty(realFileExts)) { realFileExts = "*.*"; } this.Page.RegisterClientScriptBlock("jquery1.7.2", "<script language='JavaScript' src='" + BP.WF.Glo.CCFlowAppPath + "WF/Scripts/jquery-1.7.2.min.js' ></script>"); ScriptManager.RegisterClientScriptInclude(this, this.GetType(), "jquery1.7.2", BP.WF.Glo.CCFlowAppPath + "WF/Scripts/jquery-1.7.2.min.js"); ScriptManager.RegisterClientScriptInclude(this, this.GetType(), "uploadify", "" + BP.WF.Glo.CCFlowAppPath + "WF/Scripts/Jquery-plug/fileupload/jquery.uploadify.min.js"); this.Page.RegisterClientScriptBlock("jqueryUpSwfcss", "<link href='" + BP.WF.Glo.CCFlowAppPath + "WF/Scripts/Jquery-plug/fileupload/uploadify.css' rel='stylesheet' type='text/css' />"); //输出按钮 System.Text.StringBuilder uploadJS = new System.Text.StringBuilder(); uploadJS.Append("<script language='javascript' type='text/javascript'> "); uploadJS.Append("\t\n $(function() {"); uploadJS.Append("\t\n $('#file_upload').uploadify({"); uploadJS.Append("\t\n 'swf': '" + BP.WF.Glo.CCFlowAppPath + "WF/Scripts/Jquery-plug/fileupload/uploadify.swf',"); uploadJS.Append("\t\n 'uploader': '" + BP.WF.Glo.CCFlowAppPath + "WF/CCForm/CCFormHeader.ashx?AttachPK=" + this.FK_FrmAttachment + "&WorkID=" + this.PKVal + "&DoType=MoreAttach&FK_Node=" + this.FK_Node + "&EnsName=" + this.EnName + "&FK_Flow=" + this.FK_Flow + "&PKVal=" + this.PKVal + "',"); //uploadJS.Append("\t\n 'cancelImage': '" + BP.WF.Glo.CCFlowAppPath + "WF/Scripts/Jquery-plug/fileupload/cancel.png',"); uploadJS.Append("\t\n 'auto': true,"); uploadJS.Append("\t\n 'fileTypeDesc':'请选择上传文件',"); uploadJS.Append("\t\n 'buttonText':'批量上传',"); uploadJS.Append("\t\n 'width' :60,"); uploadJS.Append("\t\n 'fileTypeExts':'" + realFileExts + "',"); uploadJS.Append("\t\n 'height' :15,"); uploadJS.Append("\t\n 'multi' :true,"); uploadJS.Append("\t\n 'queueSizeLimit':999,"); uploadJS.Append("\t\n 'onQueueComplete': function (queueData ) {"); uploadJS.Append("\t\n UploadChange('" + Btn_Upload + "');"); uploadJS.Append("\t\n },"); uploadJS.Append("\t\n 'removeCompleted' : false"); uploadJS.Append("\t\n });"); uploadJS.Append("\t\n });"); uploadJS.Append("\t\n </script>"); this.Pub1.Add("<div id='file_upload-queue' class='uploadify-queue'></div>"); this.Pub1.Add("<div id='s' style='text-align:right;float:right' ><input type='file' name='file_upload' id='file_upload' /></div>"); this.Pub1.Add(uploadJS.ToString()); #endregion if (athDesc.IsNote) { TextBox tb = new TextBox(); tb.ID = "TB_Note"; tb.Attributes["Width"] = "90%"; tb.Attributes["style"] = "display:none;"; // tb.Attributes["class"] = "TBNote"; tb.Columns = 30; // this.Pub1.Add(" 备注:"); this.Pub1.Add(tb); } } else { this.Pub1.Add("文件:"); System.Web.UI.WebControls.FileUpload fu = new System.Web.UI.WebControls.FileUpload(); fu.ID = "file"; fu.BorderStyle = BorderStyle.NotSet; fu.Attributes["onchange"] = "UploadChange('Btn_Upload');"; this.Pub1.Add(fu); Button btn = new Button(); btn.Text = "上传"; btn.ID = "Btn_Upload"; btn.CssClass = "Btn"; btn.Click += new EventHandler(btn_Click); btn.Attributes["style"] = "display:none;"; this.Pub1.Add(btn); } this.Pub1.AddTDEnd(); this.Pub1.AddTREnd(); } }
private void InitOffice(bool isMenu) { bool isCompleate = false; BP.WF.Node node = new BP.WF.Node(); node.NodeID = int.Parse(this.FK_Node); node.RetrieveFromDBSources(); try { WorkFlow workFlow = new WorkFlow(node.FK_Flow, Int64.Parse(PKVal)); isCompleate = workFlow.IsComplete; } catch (Exception) { try { Flow fl = new Flow(node.FK_Flow); GERpt rpt = fl.HisGERpt; rpt.OID = Int64.Parse(PKVal); rpt.Retrieve(); if (rpt != null) { if (rpt.WFState == WFState.Complete) { isCompleate = true; } } } catch { } } if (!isCompleate) { try { isCompleate = !BP.WF.Dev2Interface.Flow_IsCanDoCurrentWork(node.FK_Flow, node.NodeID, Int64.Parse(PKVal), WebUser.No); //WorkFlow workFlow = new WorkFlow(node.FK_Flow, Int64.Parse(PKVal)); //isCompleate = !workFlow.IsCanDoCurrentWork(WebUser.No); } catch { } } FrmAttachment attachment = new FrmAttachment(); int result = 0; //表单编号与节点不为空 if (this.FK_MapData != null && this.FK_Node != null) { BP.En.QueryObject objInfo = new BP.En.QueryObject(attachment); objInfo.AddWhere(FrmAttachmentAttr.FK_MapData, this.FK_MapData); objInfo.addAnd(); objInfo.AddWhere(FrmAttachmentAttr.FK_Node, this.FK_Node); objInfo.addAnd(); objInfo.AddWhere(FrmAttachmentAttr.NoOfObj, this.NoOfObj); result = objInfo.DoQuery(); //result = attachment.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData, // FrmAttachmentAttr.FK_Node, this.FK_Node, FrmAttachmentAttr.NoOfObj, this.DelPKVal); } if (result == 0) /*如果没有定义,就获取默认的.*/ { attachment.MyPK = this.FK_FrmAttachment; attachment.Retrieve(); } if (!isCompleate) { if (attachment.IsWoEnableReadonly) { ReadOnly = true; } if (attachment.IsWoEnableCheck) { IsCheck = true; } IsMarks = attachment.IsWoEnableMarks; } else { if (attachment.IsWoEnableReadonly) { ReadOnly = true; } } if (isMenu && !isCompleate) { #region 初始化按钮 if (attachment.IsWoEnableViewKeepMark) { divMenu.InnerHtml = "<select id='marks' onchange='ShowUserName()' style='width: 100px'><option value='1'>显示留痕</option><option value='2'>隐藏留痕</option><select>"; } if (attachment.IsWoEnableTemplete) { AddBtn("openTempLate", "打开模板", "OpenTempLate"); } if (attachment.IsWoEnableSave) { AddBtn("saveFile", "保存", "saveOffice"); } if (attachment.IsWoEnableRevise) { AddBtn("accept", "接受修订", "acceptOffice"); AddBtn("refuse", "拒绝修订", "refuseOffice"); } if (attachment.IsWoEnableOver) { AddBtn("over", "套红文件", "overOffice"); } if (attachment.IsWoEnableSeal) { AddBtn("seal", "签章", "sealOffice"); } if (attachment.IsWoEnableInsertFlow) { AddBtn("flow", "插入流程图", "InsertFlow"); } if (attachment.IsWoEnableInsertFlow) { AddBtn("fegnxian", "插入风险点", "InsertFengXian"); } #endregion } #region 初始化文件 FrmAttachmentDB downDB = new FrmAttachmentDB(); downDB.MyPK = this.DelPKVal; downDB.Retrieve(); fileName.Text = downDB.FileName; fileType.Text = downDB.FileExts; RealFileName = downDB.FileName; FileFullName = downDB.FileFullName; FileSavePath = attachment.SaveTo; #endregion }
protected void Page_Load(object sender, EventArgs e) { string action = Request["action"]; string name = null; if (BP.Web.WebUser.No == "Guest") { name = BP.Web.GuestUser.Name; } else { name = BP.Web.WebUser.Name; } TB_User.Value = name; FrmAttachmentDB downDB = new FrmAttachmentDB(); if (DoType.Equals("EditOffice")) { if (!string.IsNullOrEmpty(DelPKVal)) { downDB.MyPK = this.DelPKVal; downDB.Retrieve(); TB_FilePath.Value = downDB.FileFullName; TB_FileType.Value = downDB.FileExts; } if (!string.IsNullOrEmpty(this.FK_FrmAttachment)) { FrmAttachment attachment = new FrmAttachment(); int result = 0; //表单编号与节点不为空 if (this.FK_MapData != null && this.FK_Node != null) { BP.En.QueryObject objInfo = new BP.En.QueryObject(attachment); objInfo.AddWhere(FrmAttachmentAttr.FK_MapData, this.FK_MapData); objInfo.addAnd(); objInfo.AddWhere(FrmAttachmentAttr.FK_Node, this.FK_Node); objInfo.addAnd(); objInfo.AddWhere(FrmAttachmentAttr.NoOfObj, this.NoOfObj); result = objInfo.DoQuery(); //result = attachment.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData, // FrmAttachmentAttr.FK_Node, this.FK_Node, FrmAttachmentAttr.NoOfObj, this.DelPKVal); } if (result == 0) /*如果没有定义,就获取默认的.*/ { attachment.MyPK = this.FK_FrmAttachment; attachment.Retrieve(); } if (!attachment.IsWoEnableSave) { Btn_Save.Visible = false; } if (attachment.IsWoEnableReadonly) { TB_IsReadOnly.Value = "1"; } else { TB_IsReadOnly.Value = "0"; } if (!attachment.IsWoEnableRevise) { Btn_AttachDoc.Visible = false; Btn_UnAttachDoc.Visible = false; } if (!attachment.IsWoEnablePrint) { TB_IsPrint.Value = "0"; } else { TB_IsPrint.Value = "1"; } if (!attachment.IsWoEnableViewKeepMark) { sShowName.Visible = false; } } } if (!string.IsNullOrEmpty(action)) { if (action.Equals("SaveFile")) { SaveFile(); } else if (action.Equals("LoadFile")) { LoadFile(); } else if (action.Equals("LoadFlow")) { GetFlow(); } } }
private void SingleAttach(HttpContext context, string attachPk, string workid, string fk_node, string ensName) { FrmAttachment frmAth = new FrmAttachment(); frmAth.MyPK = attachPk; frmAth.RetrieveFromDBSources(); string athDBPK = attachPk + "_" + workid; BP.WF.Node currND = new BP.WF.Node(fk_node); BP.WF.Work currWK = currND.HisWork; currWK.OID = long.Parse(workid); currWK.Retrieve(); //处理保存路径. string saveTo = frmAth.SaveTo; if (saveTo.Contains("*") || saveTo.Contains("@")) { /*如果路径里有变量.*/ saveTo = saveTo.Replace("*", "@"); saveTo = BP.WF.Glo.DealExp(saveTo, currWK, null); } try { saveTo = context.Server.MapPath("~/" + saveTo); } catch (Exception) { saveTo = saveTo; } if (System.IO.Directory.Exists(saveTo) == false) { System.IO.Directory.CreateDirectory(saveTo); } saveTo = saveTo + "\\" + athDBPK + "." + context.Request.Files[0].FileName.Substring(context.Request.Files[0].FileName.LastIndexOf('.') + 1); context.Request.Files[0].SaveAs(saveTo); FileInfo info = new FileInfo(saveTo); FrmAttachmentDB dbUpload = new FrmAttachmentDB(); dbUpload.MyPK = athDBPK; dbUpload.FK_FrmAttachment = attachPk; dbUpload.RefPKVal = workid; dbUpload.FK_MapData = ensName; dbUpload.FileExts = info.Extension; dbUpload.FileFullName = saveTo; dbUpload.FileName = context.Request.Files[0].FileName; dbUpload.FileSize = (float)info.Length; dbUpload.Rec = WebUser.No; dbUpload.RecName = WebUser.Name; dbUpload.RDT = BP.DA.DataType.CurrentDataTime; dbUpload.NodeID = fk_node; dbUpload.Save(); }
protected void Page_Load(object sender, EventArgs e) { try { switch (this.DoType) { case "DownTempFrm": MapData md = new MapData(this.FK_MapData); DataSet ds = md.GenerHisDataSet(); string name = "ccflow表单模板." + md.Name + "." + md.No + ".xml"; string file = this.Request.PhysicalApplicationPath + "\\Temp\\" + this.FK_MapData + ".xml"; ds.WriteXml(file); this.Response.Redirect("../../Temp/" + this.FK_MapData + ".xml", true); this.WinClose(); break; case "CCForm": this.Application.Clear(); if (WebUser.NoOfRel != "admin") { BP.Port.Emp emp = new BP.Port.Emp("admin"); BP.Web.WebUser.SignInOfGener(emp); } MapAttr mattr = new MapAttr(); mattr.MyPK = this.Request.QueryString["MyPK"]; int i = mattr.RetrieveFromDBSources(); mattr.KeyOfEn = this.Request.QueryString["KeyOfEn"]; mattr.FK_MapData = this.Request.QueryString["FK_MapData"]; mattr.MyDataType = int.Parse(this.Request.QueryString["DataType"]); if (!string.IsNullOrEmpty(this.Request.QueryString["UIBindKey"] + "")) { mattr.UIBindKey = this.Request.QueryString["UIBindKey"]; } mattr.UIContralType = (UIContralType)int.Parse(this.Request.QueryString["UIContralType"]); mattr.LGType = (BP.En.FieldTypeS) int.Parse(this.Request.QueryString["LGType"]); if (i == 0) { mattr.Name = System.Web.HttpUtility.UrlDecode(this.Request.QueryString["KeyName"], System.Text.Encoding.GetEncoding("GB2312")); mattr.UIIsEnable = true; mattr.UIVisible = true; if (mattr.LGType == FieldTypeS.Enum) { mattr.DefVal = "0"; } mattr.Insert(); } else { mattr.Update(); } switch (mattr.LGType) { case BP.En.FieldTypeS.Enum: this.Response.Redirect("EditEnum.aspx?MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK, true); return; case BP.En.FieldTypeS.Normal: this.Response.Redirect("EditF.aspx?DoType=Edit&MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK + "&FType=" + mattr.MyDataType + "&GroupField=0", true); return; case BP.En.FieldTypeS.FK: this.Response.Redirect("EditTable.aspx?DoType=Edit&MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK + "&FType=" + mattr.MyDataType + "&GroupField=0", true); return; default: break; } break; case "DobackToF": MapAttr ma = new MapAttr(this.RefNo); switch (ma.LGType) { case FieldTypeS.Normal: this.Response.Redirect("EditF.aspx?RefNo=" + this.RefNo, true); return; case FieldTypeS.FK: this.Response.Redirect("EditTable.aspx?RefNo=" + this.RefNo, true); return; case FieldTypeS.Enum: this.Response.Redirect("EditEnum.aspx?RefNo=" + this.RefNo, true); return; default: return; } break; case "AddEnum": SysEnumMain sem1 = new SysEnumMain(this.Request.QueryString["EnumKey"]); MapAttr attrAdd = new MapAttr(); attrAdd.KeyOfEn = sem1.No; if (attrAdd.IsExit(MapAttrAttr.FK_MapData, this.MyPK, MapAttrAttr.KeyOfEn, sem1.No)) { BP.Sys.PubClass.Alert("字段已经存在 [" + sem1.No + "]。"); BP.Sys.PubClass.WinClose(); return; } attrAdd.FK_MapData = this.MyPK; attrAdd.Name = sem1.Name; attrAdd.UIContralType = UIContralType.DDL; attrAdd.UIBindKey = sem1.No; attrAdd.MyDataType = BP.DA.DataType.AppInt; attrAdd.LGType = FieldTypeS.Enum; attrAdd.DefVal = "0"; attrAdd.UIIsEnable = true; if (this.Idx == null || this.Idx == "") { MapAttrs attrs1 = new MapAttrs(this.MyPK); attrAdd.Idx = 0; } else { attrAdd.Idx = int.Parse(this.Idx); } attrAdd.Insert(); this.Response.Redirect("EditEnum.aspx?MyPK=" + this.MyPK + "&RefNo=" + attrAdd.MyPK, true); this.WinClose(); return; case "DelEnum": string eKey = this.Request.QueryString["EnumKey"]; SysEnumMain sem = new SysEnumMain(); sem.No = eKey; sem.Delete(); this.WinClose(); return; case "AddSysEnum": this.AddFEnum(); break; case "AddSFTable": this.AddSFTable(); break; case "AddSFTableAttr": SFTable sf = new SFTable(this.Request.QueryString["RefNo"]); this.Response.Redirect("EditTable.aspx?MyPK=" + this.MyPK + "&SFKey=" + sf.No, true); this.WinClose(); return; case "AddFG": /*执行一个插入列组的命令.*/ switch (this.RefNo) { case "IsPass": MapDtl dtl = new MapDtl(this.FK_MapData); dtl.IsEnablePass = true; /*更新是否启动审核分组字段.*/ MapAttr attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "Check_Note"; attr.Name = "审核意见"; attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.DefVal = "同意"; attr.UIIsEnable = true; attr.UIIsLine = true; attr.MaxLen = 4000; attr.ColSpan = 4; // 默认为4列。 attr.Idx = 1; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "Checker"; attr.Name = "审核人";// "审核人"; attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.MaxLen = 50; attr.MinLen = 0; attr.UIIsEnable = true; attr.UIIsLine = false; attr.DefVal = "@WebUser.Name"; attr.UIIsEnable = false; attr.IsSigan = true; attr.Idx = 2; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "IsPass"; attr.Name = "通过否?";// "审核人"; attr.MyDataType = DataType.AppBoolean; attr.UIContralType = UIContralType.CheckBok; attr.UIIsEnable = true; attr.UIIsLine = false; attr.UIIsEnable = false; attr.IsSigan = true; attr.DefVal = "1"; attr.Idx = 2; attr.DefVal = "0"; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "Check_RDT"; attr.Name = "审核日期"; // "审核日期"; attr.MyDataType = DataType.AppDateTime; attr.UIContralType = UIContralType.TB; attr.UIIsEnable = true; attr.UIIsLine = false; attr.DefVal = "@RDT"; attr.UIIsEnable = false; attr.Idx = 3; attr.Insert(); /* 处理批次ID*/ attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "BatchID"; attr.Name = "BatchID"; // this.ToE("IsPass", "是否通过");// "审核人"; attr.MyDataType = DataType.AppInt; attr.UIIsEnable = false; attr.UIIsLine = false; attr.UIIsEnable = false; attr.UIVisible = false; attr.Idx = 2; attr.DefVal = "0"; attr.Insert(); dtl.Update(); this.WinClose(); return; case "Eval": /* 质量评价 */ attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "EvalEmpNo"; attr.Name = "被评价人员编号"; attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.MaxLen = 50; attr.MinLen = 0; attr.UIIsEnable = true; attr.UIIsLine = false; attr.UIIsEnable = false; attr.IsSigan = true; attr.Idx = 1; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "EvalEmpName"; attr.Name = "被评价人员名称"; attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.MaxLen = 50; attr.MinLen = 0; attr.UIIsEnable = true; attr.UIIsLine = false; attr.UIIsEnable = false; attr.IsSigan = true; attr.Idx = 2; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "EvalCent"; attr.Name = "工作得分"; attr.MyDataType = DataType.AppFloat; attr.UIContralType = UIContralType.TB; attr.MaxLen = 50; attr.MinLen = 0; attr.UIIsEnable = true; attr.UIIsLine = false; attr.UIIsEnable = true; attr.Idx = 3; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = this.FK_MapData; attr.KeyOfEn = "EvalNote"; attr.Name = "评价信息"; attr.MyDataType = DataType.AppString; attr.UIContralType = UIContralType.TB; attr.MaxLen = 50; attr.MinLen = 0; attr.UIIsEnable = true; attr.UIIsEnable = true; attr.Idx = 4; attr.Insert(); this.WinClose(); return; default: break; } break; case "AddFGroup": this.AddFGroup(); return; case "AddF": case "ChoseFType": this.AddF(); break; case "Up": MapAttr attrU = new MapAttr(this.RefNo); if (this.Request.QueryString["IsDtl"] != null) { attrU.DoDtlUp(); } else { attrU.DoUp(); } this.WinClose(); break; case "Down": //让一个字段下移动. MapAttr attrD = new MapAttr(this.RefNo); attrD.DoDown(); this.WinClose(); break; case "DownAttr": //让一个字段下移动. MapAttr attrAttr = new MapAttr(this.RefNo); attrAttr.DoDtlDown(); this.WinClose(); break; case "Jump": MapAttr attrFrom = new MapAttr(this.Request.QueryString["FromID"]); MapAttr attrTo = new MapAttr(this.Request.QueryString["ToID"]); attrFrom.DoJump(attrTo); this.WinClose(); break; case "MoveTo": string toID = this.Request.QueryString["ToID"]; int toGFID = int.Parse(this.Request.QueryString["ToGID"]); int fromGID = int.Parse(this.Request.QueryString["FromGID"]); string fromID = this.Request.QueryString["FromID"]; MapAttr fromAttr = new MapAttr(); fromAttr.MyPK = fromID; fromAttr.Retrieve(); if (toGFID == fromAttr.GroupID && fromAttr.MyPK == toID) { /* 如果没有移动. */ this.WinClose(); return; } if (toGFID != fromAttr.GroupID && fromAttr.MyPK == toID) { MapAttr toAttr = new MapAttr(toID); fromAttr.Update(MapAttrAttr.GroupID, toAttr.GroupID, MapAttrAttr.Idx, toAttr.Idx); this.WinClose(); return; } this.Response.Redirect(this.Request.RawUrl.Replace("MoveTo", "Jump"), true); return; case "Edit": Edit(); break; case "Del": MapAttr attrDel = new MapAttr(); attrDel.MyPK = this.RefNo; attrDel.Delete(); this.WinClose(); break; case "GFDoUp": GroupField gf = new GroupField(this.RefOID); gf.DoUp(); gf.Retrieve(); if (gf.Idx == 0) { this.WinClose(); return; } int oidIdx = gf.Idx; gf.Idx = gf.Idx - 1; GroupField gfUp = new GroupField(); if (gfUp.Retrieve(GroupFieldAttr.EnName, gf.EnName, GroupFieldAttr.Idx, gf.Idx) == 1) { gfUp.Idx = oidIdx; gfUp.Update(); } gf.Update(); this.WinClose(); break; case "GFDoDown": GroupField mygf = new GroupField(this.RefOID); mygf.DoDown(); mygf.Retrieve(); int oidIdx1 = mygf.Idx; mygf.Idx = mygf.Idx + 1; GroupField gfDown = new GroupField(); if (gfDown.Retrieve(GroupFieldAttr.EnName, mygf.EnName, GroupFieldAttr.Idx, mygf.Idx) == 1) { gfDown.Idx = oidIdx1; gfDown.Update(); } mygf.Update(); this.WinClose(); break; case "AthDoUp": FrmAttachment frmAth = new FrmAttachment(this.MyPK); if (frmAth.RowIdx > 0) { frmAth.RowIdx = frmAth.RowIdx - 1; frmAth.Update(); } this.WinClose(); break; case "AthDoDown": FrmAttachment frmAthD = new FrmAttachment(this.MyPK); if (frmAthD.RowIdx < 10) { frmAthD.RowIdx = frmAthD.RowIdx + 1; frmAthD.Update(); } this.WinClose(); break; case "DtlDoUp": MapDtl dtl1 = new MapDtl(this.MyPK); if (dtl1.RowIdx > 0) { dtl1.RowIdx = dtl1.RowIdx - 1; dtl1.Update(); } this.WinClose(); break; case "DtlDoDown": MapDtl dtl2 = new MapDtl(this.MyPK); if (dtl2.RowIdx < 10) { dtl2.RowIdx = dtl2.RowIdx + 1; dtl2.Update(); } this.WinClose(); break; case "M2MDoUp": MapM2M ddtl1 = new MapM2M(this.MyPK); if (ddtl1.RowIdx > 0) { ddtl1.RowIdx = ddtl1.RowIdx - 1; ddtl1.Update(); } this.WinClose(); break; case "M2MDoDown": MapM2M ddtl2 = new MapM2M(this.MyPK); if (ddtl2.RowIdx < 10) { ddtl2.RowIdx = ddtl2.RowIdx + 1; ddtl2.Update(); } this.WinClose(); break; case "FrameDoUp": MapFrame frame1 = new MapFrame(this.MyPK); if (frame1.RowIdx > 0) { frame1.RowIdx = frame1.RowIdx - 1; frame1.Update(); } this.WinClose(); break; case "FrameDoDown": MapFrame frame2 = new MapFrame(this.MyPK); if (frame2.RowIdx < 10) { frame2.RowIdx = frame2.RowIdx + 1; frame2.Update(); } this.WinClose(); break; default: break; } } catch (Exception ex) { this.Pub1.AddMsgOfWarning("错误:", ex.Message + " <br>" + this.Request.RawUrl); } }
protected void Btn_Start_Click(object sender, EventArgs e) { People en = new People(); en.No = this.TB_SFZ.Text; if (en.RetrieveFromDBSources() == 0) { this.Response.Write("证件号码错误....."); return; } //获得该节点需要的证照信息,并把证照写入到附件表里. Node nd = new Node(int.Parse(this.FK_Flow + "01")); Work wk = nd.HisWork; //获得附件描述. FrmAttachment ath = new FrmAttachment("ND" + nd.NodeID + "_AttachM1"); string[] sort = ath.Sort.Split(','); //获得附件类型. if (sort.Length == 1) { throw new Exception("@该流程不需要上传证照信息."); } //删除原来的数据,如果有。 FrmAttachmentDBs dbs = new FrmAttachmentDBs(); dbs.Delete(FrmAttachmentDBAttr.RefPKVal, this.WorkID); //求出证件库下的证照集合. Licenses lis = new Licenses(this.SFZ); //开始象流程的开始节点写附件数据. foreach (string str in sort) { foreach (License li in lis) { if (li.Name != str) { continue; //不是continue. } FrmAttachmentDB db = new FrmAttachmentDB(); db.MyPK = BP.DA.DBAccess.GenerGUID(); db.UploadGUID = li.MyPK; db.Rec = BP.Web.WebUser.No; db.RecName = BP.Web.WebUser.Name; db.RDT = BP.DA.DataType.CurrentDataTime; db.MyNote = "从证照库导入"; db.FID = 0; db.RefPKVal = this.WorkID.ToString(); db.FK_FrmAttachment = "ND" + nd.NodeID + "_AttachM1"; db.FK_MapData = "ND" + nd.NodeID; db.FileFullName = li.FilePath; db.FileName = str; db.FileExts = li.Ext; db.FileSize = li.FileSize; db.Sort = str; db.Insert(); } } //生成Url把其他的参数带入里面去. string url = "/WF/MyFlow.aspx?FK_Flow=" + this.FK_Flow + "&IsCheckGuide=1&DiZhi=" + en.Addr + "&SFZH=" + en.No + "&DianHua=" + en.Tel + "&XingBie=" + en.XB + "&YouJian=" + en.Email + "&XingMing=" + en.Name; this.Response.Redirect(url, true); }
protected void Page_Load(object sender, EventArgs e) { FrmAttachment ath = new FrmAttachment(); ath.MyPK = this.FK_MapData + "_" + this.Ath; if (this.Ath != null) { ath.RetrieveFromDBSources(); } ath.FK_MapData = this.FK_MapData; ath.NoOfObj = this.Ath; ath.MyPK = this.FK_MapData + "_" + this.Ath; //this.Response.Write(this.Ath); //this.Response.Write(" -- "+this.FK_MapData); this.Title = "附件属性设置"; this.Pub1.AddTable(); //this.Pub1.AddCaptionLeft("附件"); this.Pub1.AddTR(); this.Pub1.AddTDTitle("项目"); this.Pub1.AddTDTitle("采集"); this.Pub1.AddTDTitle("说明"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("编号"); TextBox tb = new TextBox(); tb.ID = "TB_" + FrmAttachmentAttr.NoOfObj; tb.Text = ath.NoOfObj; if (this.Ath != null) { tb.Enabled = false; } this.Pub1.AddTD(tb); this.Pub1.AddTD("标示号只能英文字母数字或下滑线."); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("名称"); tb = new TextBox(); tb.ID = "TB_" + FrmAttachmentAttr.Name; tb.Text = ath.Name; this.Pub1.AddTD(tb); this.Pub1.AddTD("附件的中文名称."); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("文件格式"); tb = new TextBox(); tb.ID = "TB_" + FrmAttachmentAttr.Exts; tb.Text = ath.Exts; this.Pub1.AddTD(tb); this.Pub1.AddTD("实例:doc,docx,xls,多种格式用逗号分开."); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("保存到"); tb = new TextBox(); tb.ID = "TB_" + FrmAttachmentAttr.SaveTo; tb.Text = ath.SaveTo; tb.Columns = 60; this.Pub1.AddTD("colspan=2", tb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("类别"); tb = new TextBox(); tb.ID = "TB_" + FrmAttachmentAttr.Sort; tb.Text = ath.Sort; tb.Columns = 60; this.Pub1.AddTD("colspan=2", tb); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("colspan=3", "帮助:类别可以为空,设置的格式为:类别名1,类别名2,类别名3"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD(""); CheckBox cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsDownload; cb.Text = "是否可下载"; cb.Checked = ath.IsDownload; this.Pub1.AddTD(cb); this.Pub1.AddTD(); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD(""); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsDelete; cb.Text = "是否可删除"; cb.Checked = ath.IsDelete; this.Pub1.AddTD(cb); this.Pub1.AddTD(); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD(""); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsUpload; cb.Text = "是否可上传"; cb.Checked = ath.IsUpload; this.Pub1.AddTD(cb); this.Pub1.AddTD(); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD(""); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsNote; cb.Text = "是否增加备注列"; cb.Checked = ath.IsNote; this.Pub1.AddTD(cb); this.Pub1.AddTD(); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("高度"); BP.Web.Controls.TB mytb = new BP.Web.Controls.TB(); mytb.ID = "TB_" + FrmAttachmentAttr.H; mytb.Text = ath.H.ToString(); mytb.ShowType = BP.Web.Controls.TBType.Float; this.Pub1.AddTD("colspan=1", mytb); this.Pub1.AddTD("对傻瓜表单有效"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("宽度"); mytb = new BP.Web.Controls.TB(); mytb.ID = "TB_" + FrmAttachmentAttr.W; mytb.Text = ath.W.ToString(); mytb.ShowType = BP.Web.Controls.TBType.Float; mytb.Columns = 60; this.Pub1.AddTD("colspan=1", mytb); this.Pub1.AddTD("对傻瓜表单有效"); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD("自动控制"); cb = new CheckBox(); cb.ID = "CB_" + FrmAttachmentAttr.IsAutoSize; cb.Text = "自动控制高度与宽度(对傻瓜表单有效)"; cb.Checked = ath.IsAutoSize; this.Pub1.AddTD("colspan=2", cb); this.Pub1.AddTREnd(); GroupFields gfs = new GroupFields(ath.FK_MapData); this.Pub1.AddTR1(); this.Pub1.AddTD("显示在分组"); BP.Web.Controls.DDL ddl = new BP.Web.Controls.DDL(); ddl.ID = "DDL_GroupField"; ddl.BindEntities(gfs, GroupFieldAttr.OID, GroupFieldAttr.Lab, false, BP.Web.Controls.AddAllLocation.None); ddl.SetSelectItem(ath.GroupID); this.Pub1.AddTD("colspan=2", ddl); this.Pub1.AddTREnd(); this.Pub1.AddTR(); this.Pub1.AddTD(""); Button btn = new Button(); btn.ID = "Btn_Save"; btn.Text = " Save "; btn.CssClass = "Btn"; btn.Click += new EventHandler(btn_Click); this.Pub1.AddTD(btn); if (this.Ath != null) { btn = new Button(); btn.ID = "Btn_Delete"; btn.Text = " Delete "; btn.CssClass = "Btn"; btn.Attributes["onclick"] = " return confirm('您确认吗?');"; btn.Click += new EventHandler(btn_Click); this.Pub1.AddTD(btn); } else { this.Pub1.AddTD(); } this.Pub1.AddTREnd(); this.Pub1.AddTableEnd(); }
/// <summary> /// 保存到证照数据库. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Btn_SaveToEntity_Click(object sender, EventArgs e) { People pe = new People(); pe.No = this.TB_SFZ.Text; if (pe.No.Length <= 15) { this.Response.Write("@身份证,不符合要求."); return; } pe.Name = this.TB_Name.Text; pe.Addr = this.TB_Addr.Text; pe.Email = this.TB_Email.Text; pe.Tel = this.TB_Tel.Text; pe.XB = this.TB_XB.Text; pe.Age = this.TB_Age.Text; pe.BDT = this.TB_BDT.Text; pe.Save(); #region 保存附件. //获得该节点需要的证照信息,并把证照写入到附件表里. Node nd = new Node(int.Parse(this.FK_Flow + "01")); Work wk = nd.HisWork; //获得附件描述. FrmAttachment ath = new FrmAttachment("ND" + nd.NodeID + "_AttachM1"); string[] sorts = ath.Sort.Split(','); //获得附件类型. if (sorts.Length == 1) { throw new Exception("@该流程不需要上传证照信息,或者设计人员配置错误,没有设计要上传的证照类型."); } Licenses ens = new Licenses(this.SFZ); string types = ""; foreach (License en in ens) { types += en.Name + ","; } foreach (string str in sorts) { if (types.Contains(str)) { continue; } string id = "N_" + LicenseType.GetIDByName(str); FileUpload fu = (FileUpload)this.Pub1.FindControl(id); if (fu == null) { throw new Exception("@没有找到ID" + id + "的上传控件."); } if (fu.HasFile == false) { continue; } //处理路径. string path = SystemConfig.PathOfDataUser + "\\UploadFile\\" + BP.DA.DataType.CurrentYear + "\\" + this.FK_Flow; if (System.IO.Directory.Exists(path) == false) { System.IO.Directory.CreateDirectory(path); } //保存一个临时文件. string tempFile = path + "\\" + fu.FileName; fu.SaveAs(tempFile); System.IO.FileInfo finfo = new System.IO.FileInfo(tempFile); string guid = BP.DA.DBAccess.GenerGUID(); License li = new License(); li.MyPK = guid; li.SFZ = this.SFZ; li.ZJCode = ""; li.ZJLX = str; //证件类型. li.ZJLX = LicenseType.GetIDByName(str); //按照Guid + 扩展名存储临时文件. li.FilePath = path + "\\" + guid + "." + finfo.Extension; finfo.MoveTo(li.FilePath); //把当前的文件重命名. li.Rec = BP.Web.WebUser.No; li.RDT = BP.DA.DataType.CurrentData; li.Ext = finfo.Extension; li.FileSize = (float)finfo.Length; li.Insert(); } #endregion 保存附件. string paras = this.RequestParas; if (paras.Contains("SFZ=") == false) { paras += "&SFZ=" + pe.No; } //转到当前界面. this.Response.Redirect("StartGuideSelfUrlEntity.aspx?1=1" + paras, true); }
public void BindData() { if (this.SFZ == null || this.SFZ.Length < 15) { return; } People pl = new People(); pl.No = this.SFZ; pl.RetrieveFromDBSources(); this.TB_Name.Text = pl.Name; this.TB_SFZ.Text = pl.No; this.TB_Tel.Text = pl.Tel; this.TB_Addr.Text = pl.Addr; this.TB_Email.Text = pl.Email; this.TB_BDT.Text = pl.BDT; this.TB_XB.Text = pl.XB; this.Pub1.AddTR(); this.Pub1.AddTH("类型"); this.Pub1.AddTH("上传日期/上传人/编码"); this.Pub1.AddTH("上传"); this.Pub1.AddTH("操作"); this.Pub1.AddTREnd(); #region 绑定已经存在的证照. Licenses ens = new Licenses(this.SFZ); string types = ""; foreach (License en in ens) { types += en.Name + ","; this.Pub1.AddTR(); this.Pub1.AddTD(en.Name); this.Pub1.AddTD(en.RDT + "/" + en.Rec + "/" + en.ZJCode); FileUpload fu = new FileUpload(); fu.ID = en.MyPK; this.Pub1.AddTD(fu); //this.Pub1.AddTD("[<a href=\"javascript:Del('" + en.MyPK + "','" + en.SFZ + "')\'>删除</a>]"); this.Pub1.AddTD("[删除][查看]"); this.Pub1.AddTREnd(); } #endregion 绑定已经存在的证照. #region 绑定节点需要的证照. //获得该节点需要的证照信息,并把证照写入到附件表里. Node nd = new Node(int.Parse(this.FK_Flow + "01")); //获得附件描述. FrmAttachment ath = new FrmAttachment("ND" + nd.NodeID + "_AttachM1"); string[] sorts = ath.Sort.Split(','); //获得附件类型. if (sorts.Length == 1) { throw new Exception("@该流程不需要上传证照信息,或者设计人员配置错误,没有设计要上传的证照类型."); } foreach (string str in sorts) { if (types.Contains(str)) { continue; } this.Pub1.AddTR(); this.Pub1.AddTD(str); //名称 this.Pub1.AddTD("无/无/无"); //代码 FileUpload fu = new FileUpload(); fu.ID = "N_" + LicenseType.GetIDByName(str); this.Pub1.AddTD(fu); //上传 this.Pub1.AddTD("无"); // 操作 this.Pub1.AddTREnd(); } #endregion 绑定节点需要的证照. }
public string DoType(string dotype, string v1, string v2, string v3, string v4, string v5) { string sql = ""; try { switch (dotype) { case "CreateCheckGroup": string gKey = v1; string gName = v2; string enName1 = v3; MapAttr attrN = new MapAttr(); int i = attrN.Retrieve(MapAttrAttr.FK_MapData, enName1, MapAttrAttr.KeyOfEn, gKey + "_Note"); i += attrN.Retrieve(MapAttrAttr.FK_MapData, enName1, MapAttrAttr.KeyOfEn, gKey + "_Checker"); i += attrN.Retrieve(MapAttrAttr.FK_MapData, enName1, MapAttrAttr.KeyOfEn, gKey + "_RDT"); if (i > 0) { return("前缀已经使用:" + gKey + " , 请确认您是否增加了这个审核分组或者,请您更换其他的前缀。"); } GroupField gf = new GroupField(); gf.Lab = gName; gf.EnName = enName1; gf.Insert(); attrN = new MapAttr(); attrN.FK_MapData = enName1; attrN.KeyOfEn = gKey + "_Note"; attrN.Name = "审核意见"; attrN.MyDataType = DataType.AppString; attrN.UIContralType = UIContralType.TB; attrN.UIIsEnable = true; attrN.UIIsLine = true; attrN.MaxLen = 4000; attrN.GroupID = gf.OID; attrN.UIHeight = 23 * 3; attrN.IDX = 1; attrN.Insert(); attrN = new MapAttr(); attrN.FK_MapData = enName1; attrN.KeyOfEn = gKey + "_Checker"; attrN.Name = "审核人";// "审核人"; attrN.MyDataType = DataType.AppString; attrN.UIContralType = UIContralType.TB; attrN.MaxLen = 50; attrN.MinLen = 0; attrN.UIIsEnable = true; attrN.UIIsLine = false; attrN.DefVal = "@WebUser.Name"; attrN.UIIsEnable = false; attrN.GroupID = gf.OID; attrN.IsSigan = true; attrN.IDX = 2; attrN.Insert(); attrN = new MapAttr(); attrN.FK_MapData = enName1; attrN.KeyOfEn = gKey + "_RDT"; attrN.Name = "审核日期"; // "审核日期"; attrN.MyDataType = DataType.AppDateTime; attrN.UIContralType = UIContralType.TB; attrN.UIIsEnable = true; attrN.UIIsLine = false; attrN.DefVal = "@RDT"; attrN.UIIsEnable = false; attrN.GroupID = gf.OID; attrN.IDX = 3; attrN.Insert(); return(null); case "NewDtl": MapDtl dtlN = new MapDtl(); dtlN.No = v1; if (dtlN.RetrieveFromDBSources() != 0) { return("从表已存在"); } dtlN.Name = v1; dtlN.FK_MapData = v2; dtlN.PTable = v1; dtlN.Insert(); dtlN.IntMapAttrs(); return(null); case "DelM2M": MapM2M m2mDel = new MapM2M(); m2mDel.MyPK = v1; m2mDel.Delete(); //M2M m2mData = new M2M(); //m2mData.Delete(M2MAttr.FK_MapData, v1); return(null); case "NewAthM": // 新建 NewAthM. string fk_mapdataAth = v1; string athName = v2; BP.Sys.FrmAttachment athM = new FrmAttachment(); athM.MyPK = athName; if (athM.IsExits) { return("多选名称:" + athName + ",已经存在。"); } athM.X = float.Parse(v3); athM.Y = float.Parse(v4); athM.Name = "多文件上传"; athM.FK_MapData = fk_mapdataAth; athM.Insert(); return(null); case "NewM2M": string fk_mapdataM2M = v1; string m2mName = v2; MapM2M m2m = new MapM2M(); m2m.FK_MapData = v1; m2m.NoOfObj = v2; if (v3 == "0") { m2m.HisM2MType = M2MType.M2M; m2m.Name = "新建一对多"; } else { m2m.HisM2MType = M2MType.M2MM; m2m.Name = "新建一对多多"; } m2m.X = float.Parse(v4); m2m.Y = float.Parse(v5); m2m.MyPK = m2m.FK_MapData + "_" + m2m.NoOfObj; if (m2m.IsExits) { return("多选名称:" + m2mName + ",已经存在。"); } m2m.Insert(); return(null); case "DelEnum": // 检查这个物理表是否被使用。 sql = "SELECT * FROM Sys_MapAttr WHERE UIBindKey='" + v1 + "'"; DataTable dtEnum = DBAccess.RunSQLReturnTable(sql); string msgDelEnum = ""; foreach (DataRow dr in dtEnum.Rows) { msgDelEnum += "\n 表单编号:" + dr["FK_MapData"] + " , 字段:" + dr["KeyOfEn"] + ", 名称:" + dr["Name"]; } if (msgDelEnum != "") { return("该枚举已经被如下字段所引用,您不能删除它。" + msgDelEnum); } sql = "DELETE FROM Sys_EnumMain WHERE No='" + v1 + "'"; sql += "@DELETE FROM Sys_Enum WHERE EnumKey='" + v1 + "' "; DBAccess.RunSQLs(sql); return(null); case "DelSFTable": /* 删除自定义的物理表. */ // 检查这个物理表是否被使用。 sql = "SELECT * FROM Sys_MapAttr WHERE UIBindKey='" + v1 + "'"; DataTable dt = DBAccess.RunSQLReturnTable(sql); string msgDel = ""; foreach (DataRow dr in dt.Rows) { msgDel += "\n 表单编号:" + dr["FK_MapData"] + " , 字段:" + dr["KeyOfEn"] + ", 名称:" + dr["Name"]; } if (msgDel != "") { return("该数据表已经被如下字段所引用,您不能删除它。" + msgDel); } SFTable sfDel = new SFTable(); sfDel.No = v1; sfDel.DirectDelete(); return(null); case "SaveSFTable": string enName = v2; string chName = v1; if (string.IsNullOrEmpty(v1) || string.IsNullOrEmpty(v2)) { return("视图中的中英文名称不能为空。"); } SFTable sf = new SFTable(); sf.No = enName; sf.Name = chName; sf.No = enName; sf.Name = chName; sf.FK_Val = enName; sf.Save(); if (DBAccess.IsExitsObject(enName) == true) { /*已经存在此对象,检查一下是否有No,Name列。*/ sql = "SELECT No,Name FROM " + enName; try { DBAccess.RunSQLReturnTable(sql); } catch (Exception ex) { return("您指定的表或视图(" + enName + "),不包含No,Name两列,不符合ccflow约定的规则。技术信息:" + ex.Message); } return(null); } else { /*创建这个表,并且插入基础数据。*/ try { // 如果没有该表或者视图,就要创建它。 sql = "CREATE TABLE " + enName + "(No varchar(30) NOT NULL,Name varchar(50) NULL)"; DBAccess.RunSQL(sql); DBAccess.RunSQL("INSERT INTO " + enName + " (No,Name) VALUES('001','Item1')"); DBAccess.RunSQL("INSERT INTO " + enName + " (No,Name) VALUES('002','Item2')"); DBAccess.RunSQL("INSERT INTO " + enName + " (No,Name) VALUES('003','Item3')"); } catch (Exception ex) { sf.DirectDelete(); return("创建物理表期间出现错误,可能是非法的物理表名.技术信息:" + ex.Message); } } return(null); /*创建成功后返回空值*/ case "FrmTempleteExp": //导出表单. MapData mdfrmtem = new MapData(); mdfrmtem.No = v1; if (mdfrmtem.RetrieveFromDBSources() == 0) { if (v1.Contains("ND")) { int nodeId = int.Parse(v1.Replace("ND", "")); Node nd = new Node(nodeId); mdfrmtem.Name = nd.Name; mdfrmtem.PTable = v1; mdfrmtem.EnPK = "OID"; mdfrmtem.Insert(); } } DataSet ds = mdfrmtem.GenerHisDataSet(); string file = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + "\\Temp\\" + v1 + ".xml"; if (System.IO.File.Exists(file)) { System.IO.File.Delete(file); } ds.WriteXml(file); // BP.PubClass.DownloadFile(file, mdfrmtem.Name + ".xml"); //this.DownLoadFile(System.Web.HttpContext.Current, file, mdfrmtem.Name); return(null); case "FrmTempleteImp": //导入表单. DataSet dsImp = new DataSet(); string fileImp = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + "\\Temp\\" + v1 + ".xml"; dsImp.ReadXml(fileImp); //读取文件. MapData.ImpMapData(v1, dsImp, true); return(null); case "NewHidF": string fk_mapdataHid = v1; string key = v2; string name = v3; int dataType = int.Parse(v4); MapAttr mdHid = new MapAttr(); mdHid.MyPK = fk_mapdataHid + "_" + key; mdHid.FK_MapData = fk_mapdataHid; mdHid.KeyOfEn = key; mdHid.Name = name; mdHid.MyDataType = dataType; mdHid.HisEditType = EditType.Edit; mdHid.MaxLen = 100; mdHid.MinLen = 0; mdHid.LGType = FieldTypeS.Normal; mdHid.UIVisible = false; mdHid.UIIsEnable = false; mdHid.Insert(); return(null); case "DelDtl": MapDtl dtl = new MapDtl(v1); dtl.Delete(); return(null); case "DeleteFrm": string delFK_Frm = v1; MapData mdDel = new MapData(delFK_Frm); mdDel.Delete(); sql = "@DELETE FROM Sys_MapData WHERE No='" + delFK_Frm + "'"; sql = "@DELETE FROM WF_FrmNode WHERE FK_Frm='" + delFK_Frm + "'"; DBAccess.RunSQLs(sql); return(null); case "FrmUp": case "FrmDown": FrmNode myfn = new FrmNode(); myfn.Retrieve(FrmNodeAttr.FK_Node, v1, FrmNodeAttr.FK_Frm, v2); if (dotype == "FrmUp") { myfn.DoUp(); } else { myfn.DoDown(); } return(null); case "SaveFlowFrm": // 转化参数意义. string vals = v1; string fk_Node = v2; string fk_flow = v3; bool isPrint = false; if (v5 == "1") { isPrint = true; } bool isReadonly = false; if (v4 == "1") { isReadonly = true; } string msg = this.SaveEn(vals); if (msg.Contains("Error")) { return(msg); } string fk_frm = msg; Frm fm = new Frm(); fm.No = fk_frm; fm.Retrieve(); FrmNode fn = new FrmNode(); if (fn.Retrieve(FrmNodeAttr.FK_Frm, fk_frm, FrmNodeAttr.FK_Node, fk_Node) == 1) { fn.IsEdit = !isReadonly; fn.IsPrint = isPrint; fn.FK_Flow = fk_flow; fn.Update(); BP.DA.DBAccess.RunSQL("UPDATE Sys_MapData SET FK_FrmSort='01',AppType=1 WHERE No='" + fk_frm + "'"); return(fk_frm); } fn.FK_Frm = fk_frm; fn.FK_Flow = fk_flow; fn.FK_Node = int.Parse(fk_Node); fn.IsEdit = !isReadonly; fn.IsPrint = isPrint; fn.Idx = 100; fn.FK_Flow = fk_flow; fn.Insert(); MapData md = new MapData(); md.No = fm.No; if (md.RetrieveFromDBSources() == 0) { md.Name = fm.Name; md.EnPK = "OID"; md.Insert(); } MapAttr attr = new MapAttr(); attr.FK_MapData = md.No; attr.KeyOfEn = "OID"; attr.Name = "WorkID"; attr.MyDataType = BP.DA.DataType.AppInt; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.DefVal = "0"; attr.HisEditType = BP.En.EditType.Readonly; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = md.No; attr.KeyOfEn = "FID"; attr.Name = "FID"; attr.MyDataType = BP.DA.DataType.AppInt; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.DefVal = "0"; attr.HisEditType = BP.En.EditType.Readonly; attr.Insert(); attr = new MapAttr(); attr.FK_MapData = md.No; attr.KeyOfEn = "RDT"; attr.Name = "记录日期"; attr.MyDataType = BP.DA.DataType.AppDateTime; attr.UIContralType = UIContralType.TB; attr.LGType = FieldTypeS.Normal; attr.UIVisible = false; attr.UIIsEnable = false; attr.DefVal = "@RDT"; attr.HisEditType = BP.En.EditType.Readonly; attr.Insert(); return(fk_frm); default: return("Error:" + dotype + " , 未设置此标记."); } } catch (Exception ex) { return("Error:" + ex.Message); } }