WorkFlowPicView.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:7k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections.Generic;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- public partial class Work_WorkFlowPicView : System.Web.UI.Page
- {
- /// <summary>
- /// 模板
- /// </summary>
- Model.FlowBaseStep MR = new Model.FlowBaseStep();
- /// <summary>
- /// 业务
- /// </summary>
- BLL.FlowBaseStep BR = new BLL.FlowBaseStep();
- public string VmlStr = "";
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "Work_WorkFlowPicView");
- string TiaoJian = "";
- if (Request.QueryString["lcid"] != null)
- {
- TiaoJian = "LCID=" + Request.QueryString["lcid"].ToString();
- }
- int RecordCount = BR.GetCount(TiaoJian);
- List<Model.FlowBaseStep> LRData = BR.GetPageList(RecordCount, 1, "BZSXH", true, TiaoJian);
- int loop = 0;
- foreach(Model.FlowBaseStep MR in LRData)
- {
- loop++;
- if (MR.BZSXH == 1)
- {
- VmlStr += TopRoundPic(MR.BZMC, MR.BZMC);//第一步
- string[] BZPoint = MR.XYBXH.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
- foreach (string SBZ in BZPoint)
- {
- VmlStr += PointerPic(MR.BZSXH.ToString(), SBZ);//箭头
- }
- }
- else
- {
- if (loop == LRData.Count)//如果为最后一步
- {
- int top = 0, left = 0;
- GetTopLeft(loop, out top, out left);
- VmlStr += EndRoundPic(left.ToString(), top.ToString(), MR.BZSXH.ToString(), MR.BZMC, MR.BZMC);
- string[] BZPoint = MR.XYBXH.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
- foreach (string SBZ in BZPoint)
- {
- VmlStr += PointerPic(MR.BZSXH.ToString(), SBZ);//箭头
- }
- }
- else
- {
- int top = 0, left = 0;
- GetTopLeft(loop, out top, out left);
- VmlStr += RoundPic(left.ToString(),top.ToString(),MR.BZSXH.ToString(),MR.BZMC, MR.BZMC);//正常步骤
- string[] BZPoint = MR.XYBXH.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
- foreach (string SBZ in BZPoint)
- {
- VmlStr += PointerPic(MR.BZSXH.ToString(), SBZ);//箭头
- }
- }
- }
-
- }
-
- }
- public void GetTopLeft(int i,out int top,out int left)
- {
- top = 50;
- left = 20;
- int toplength = 180;//50
- int leftlength = 180;//20
- if (i % 2 == 0)//双数加高
- {
- top = 230;
- int leftcount = (i-1) / 2;
- left = left + leftcount * leftlength;
- }
- else//单数加长
- {
- top = 50;
- int leftcount = i / 2;
- left = left + leftcount * leftlength;
- }
- }
- /// <summary>
- /// 第一步骤
- /// </summary>
- /// <param name="Title">提示标题</param>
- /// <param name="StepName">步骤名称</param>
- /// <returns></returns>
- public string TopRoundPic(string Title,string StepName)
- {
- string PicStr = @"<vml:roundrect id=1
- style=""Z-INDEX: 1; LEFT: 20px; VERTICAL-ALIGN: middle; WIDTH: 100px; CURSOR: hand; POSITION: absolute; TOP: 50px; HEIGHT: 50px; TEXT-ALIGN: center""
- coordsize=""21600,21600"" arcsize=""4321f"" fillcolor=""#00EE00"" receiverName=""""
- receiverID="""" readOnly=""0"" flowFlag=""0"" flowTitle=""<b>1</b><br>" + StepName + @"""
- passCount=""0"" flowType=""start"" is_child_flow=""false"" table_id=""353""
- inset=""2pt,2pt,2pt,2pt"">
- <vml:shadow offset=""3px,3px"" color=""#b3b3b3""
- type=""single"" on=""T""></vml:shadow>
- <vml:textbox onselectstart=""return false;""
- title="""+Title+@""" inset=""1pt,2pt,1pt,1pt""><B>1</B><BR>"+StepName+@"</vml:textbox>
- </vml:roundrect>";
- return PicStr;
- }
- /// <summary>
- /// 步骤
- /// </summary>
- /// <param name="Left">左边位置</param>
- /// <param name="Top">上边位置</param>
- /// <param name="ID">顺序号</param>
- /// <param name="Title">提示</param>
- /// <param name="StepName">步骤名</param>
- /// <returns></returns>
- public string RoundPic(string Left, string Top, string ID, string Title, string StepName)
- {
- string PicStr = @"<vml:roundrect id=" + ID + @"
- style=""Z-INDEX: 1; LEFT: " +Left+@"px; VERTICAL-ALIGN: middle; WIDTH: 100px; CURSOR: hand; POSITION:
- absolute; TOP: "+Top+@"px; HEIGHT: 50px; TEXT-ALIGN: center""
- coordsize=""21600,21600"" arcsize=""4321f"" fillcolor=""#EEEEEE"" receiverName=""""
- receiverID="""" readOnly=""0"" flowFlag=""0"" flowTitle=""<b>"+ID+@"</b><br>"+StepName+@"""
- passCount=""0"" flowType="""" is_child_flow=""false"" table_id=""354""
- inset=""2pt,2pt,2pt,2pt"">
- <vml:shadow offset=""3px,3px"" color=""#b3b3b3""
- type=""single"" on=""T""></vml:shadow>
- <vml:textbox onselectstart=""return false;""
- title="""+Title+@""" inset=""1pt,2pt,1pt,1pt""><B>2</B><BR>"+StepName+@"</vml:textbox>
- </vml:roundrect>";
- return PicStr;
- }
- /// <summary>
- /// 最后一骤
- /// </summary>
- /// <param name="Left">左边位置</param>
- /// <param name="Top">上边位置</param>
- /// <param name="ID">顺序号</param>
- /// <param name="Title">提示</param>
- /// <param name="StepName">步骤名</param>
- /// <returns></returns>
- public string EndRoundPic(string Left, string Top,string ID, string Title, string StepName)
- {
- string PicStr = @"<vml:roundrect id="+ID+@"
- style=""Z-INDEX: 1; LEFT: "+Left+@"px; VERTICAL-ALIGN: middle; WIDTH: 100px; CURSOR: hand; POSITION:
- absolute; TOP: "+Top+@"px; HEIGHT: 50px; TEXT-ALIGN: center""
- coordsize=""21600,21600"" arcsize=""4321f"" fillcolor=""#F4A8BD"" receiverName=""""
- receiverID="""" readOnly=""0"" flowFlag=""0"" flowTitle=""<b>0</b><br>"+StepName+@"""
- passCount=""0"" flowType=""end"" is_child_flow=""false"" table_id=""355""
- inset=""2pt,2pt,2pt,2pt"">
- <vml:shadow offset=""3px,3px"" color=""#b3b3b3""
- type=""single"" on=""T""></vml:shadow>
- <vml:textbox onselectstart=""return false;""
- title="""+Title+@"""
- inset=""1pt,2pt,1pt,1pt""><B>" + ID + @"</B><BR>" + StepName + @"</vml:textbox>
- </vml:roundrect>";
- return PicStr;
- }
- /// <summary>
- /// 画线
- /// </summary>
- /// <param name="source">源</param>
- /// <param name="Object">目标</param>
- /// <returns></returns>
- public string PointerPic(string source,string Object)
- {
- string PicStr = @"<vml:line title=""""
- style=""DISPLAY: none; Z-INDEX: 2; POSITION: absolute"" to=""0,0"" from=""0,0""
- coordsize=""21600,21600"" arcsize=""4321f"" object=""" + Object + @""" source=""" + source + @"""
- mfrID=""1"">
- <vml:stroke endarrow=""block""></vml:stroke>
- <vml:shadow offset=""1px,1px""
- color=""#b3b3b3"" type=""single"" on=""T""></vml:shadow>
- </vml:line>";
- return PicStr;
- }
- }