WorkFlowPicView.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:7k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections.Generic;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. public partial class Work_WorkFlowPicView : System.Web.UI.Page
  12. {
  13.     /// <summary>
  14.     /// 模板
  15.     /// </summary>
  16.     Model.FlowBaseStep MR = new Model.FlowBaseStep();
  17.     /// <summary>
  18.     /// 业务
  19.     /// </summary>
  20.     BLL.FlowBaseStep BR = new BLL.FlowBaseStep();
  21.     public string VmlStr = "";
  22.     protected void Page_Load(object sender, EventArgs e)
  23.     {
  24.         LoginLogic.MatchLoad("../", "Work_WorkFlowPicView");
  25.         string TiaoJian = "";
  26.         if (Request.QueryString["lcid"] != null)
  27.         {
  28.             TiaoJian = "LCID=" + Request.QueryString["lcid"].ToString();
  29.         }
  30.         int RecordCount = BR.GetCount(TiaoJian);
  31.         List<Model.FlowBaseStep> LRData = BR.GetPageList(RecordCount, 1, "BZSXH", true, TiaoJian);
  32.         int loop = 0;
  33.         foreach(Model.FlowBaseStep MR in LRData)
  34.         {
  35.             loop++;
  36.             if (MR.BZSXH == 1)
  37.             {
  38.                 VmlStr += TopRoundPic(MR.BZMC, MR.BZMC);//第一步
  39.                 string[] BZPoint = MR.XYBXH.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
  40.                 foreach (string SBZ in BZPoint)
  41.                 {
  42.                     VmlStr += PointerPic(MR.BZSXH.ToString(), SBZ);//箭头
  43.                 }
  44.             }
  45.             else
  46.             {
  47.                 if (loop == LRData.Count)//如果为最后一步
  48.                 {
  49.                     int top = 0, left = 0;
  50.                     GetTopLeft(loop, out top, out left);
  51.                     VmlStr += EndRoundPic(left.ToString(), top.ToString(), MR.BZSXH.ToString(), MR.BZMC, MR.BZMC);
  52.                     string[] BZPoint = MR.XYBXH.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
  53.                     foreach (string SBZ in BZPoint)
  54.                     {
  55.                         VmlStr += PointerPic(MR.BZSXH.ToString(), SBZ);//箭头
  56.                     }
  57.                 }
  58.                 else
  59.                 {
  60.                     int top = 0, left = 0;
  61.                     GetTopLeft(loop, out top, out left);
  62.                     VmlStr += RoundPic(left.ToString(),top.ToString(),MR.BZSXH.ToString(),MR.BZMC, MR.BZMC);//正常步骤
  63.                     string[] BZPoint = MR.XYBXH.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
  64.                     foreach (string SBZ in BZPoint)
  65.                     {
  66.                         VmlStr += PointerPic(MR.BZSXH.ToString(), SBZ);//箭头
  67.                     }
  68.                 }
  69.             }
  70.         
  71.         } 
  72.         
  73.     }
  74.     public void GetTopLeft(int i,out int top,out int left)
  75.     {
  76.      top = 50;
  77.      left = 20;
  78.      int toplength = 180;//50
  79.      int leftlength = 180;//20
  80.      if (i % 2 == 0)//双数加高
  81.      {
  82.          top = 230;
  83.          int leftcount = (i-1) / 2;
  84.          left = left + leftcount * leftlength;
  85.      }
  86.      else//单数加长
  87.      {
  88.          top = 50;
  89.          int leftcount = i / 2;
  90.          left = left + leftcount * leftlength;
  91.      }
  92.     }
  93.     /// <summary>
  94.     /// 第一步骤
  95.     /// </summary>
  96.     /// <param name="Title">提示标题</param>
  97.     /// <param name="StepName">步骤名称</param>
  98.     /// <returns></returns>
  99.     public string TopRoundPic(string Title,string StepName)
  100.     {
  101.         string PicStr = @"<vml:roundrect id=1 
  102. style=""Z-INDEX: 1; LEFT: 20px; VERTICAL-ALIGN: middle; WIDTH: 100px; CURSOR: hand; POSITION: absolute; TOP: 50px; HEIGHT: 50px; TEXT-ALIGN: center"" 
  103. coordsize=""21600,21600"" arcsize=""4321f"" fillcolor=""#00EE00"" receiverName="""" 
  104. receiverID="""" readOnly=""0"" flowFlag=""0"" flowTitle=""<b>1</b><br>" + StepName + @""" 
  105. passCount=""0"" flowType=""start"" is_child_flow=""false"" table_id=""353"" 
  106. inset=""2pt,2pt,2pt,2pt"">
  107. <vml:shadow offset=""3px,3px"" color=""#b3b3b3"" 
  108. type=""single"" on=""T""></vml:shadow>
  109. <vml:textbox onselectstart=""return false;"" 
  110. title="""+Title+@""" inset=""1pt,2pt,1pt,1pt""><B>1</B><BR>"+StepName+@"</vml:textbox> 
  111. </vml:roundrect>";
  112.         return PicStr;
  113.     }
  114.     /// <summary>
  115.     /// 步骤
  116.     /// </summary>
  117.     /// <param name="Left">左边位置</param>
  118.     /// <param name="Top">上边位置</param>
  119.     /// <param name="ID">顺序号</param>
  120.     /// <param name="Title">提示</param>
  121.     /// <param name="StepName">步骤名</param>
  122.     /// <returns></returns>
  123.     public string RoundPic(string Left, string Top, string ID, string Title, string StepName)
  124.     {
  125.         string PicStr = @"<vml:roundrect id=" + ID + @" 
  126. style=""Z-INDEX: 1; LEFT: " +Left+@"px; VERTICAL-ALIGN: middle; WIDTH: 100px; CURSOR: hand; POSITION: 
  127. absolute; TOP: "+Top+@"px; HEIGHT: 50px; TEXT-ALIGN: center"" 
  128. coordsize=""21600,21600"" arcsize=""4321f"" fillcolor=""#EEEEEE"" receiverName="""" 
  129. receiverID="""" readOnly=""0"" flowFlag=""0"" flowTitle=""<b>"+ID+@"</b><br>"+StepName+@""" 
  130. passCount=""0"" flowType="""" is_child_flow=""false"" table_id=""354"" 
  131. inset=""2pt,2pt,2pt,2pt"">
  132. <vml:shadow offset=""3px,3px"" color=""#b3b3b3"" 
  133. type=""single"" on=""T""></vml:shadow>
  134. <vml:textbox onselectstart=""return false;"" 
  135. title="""+Title+@""" inset=""1pt,2pt,1pt,1pt""><B>2</B><BR>"+StepName+@"</vml:textbox> 
  136. </vml:roundrect>";
  137.         return PicStr;
  138.     }
  139.     /// <summary>
  140.     /// 最后一骤
  141.     /// </summary>
  142.     /// <param name="Left">左边位置</param>
  143.     /// <param name="Top">上边位置</param>
  144.     /// <param name="ID">顺序号</param>
  145.     /// <param name="Title">提示</param>
  146.     /// <param name="StepName">步骤名</param>
  147.     /// <returns></returns>
  148.     public string EndRoundPic(string Left, string Top,string ID, string Title, string StepName)
  149.     {
  150.         string PicStr = @"<vml:roundrect id="+ID+@" 
  151. style=""Z-INDEX: 1; LEFT: "+Left+@"px; VERTICAL-ALIGN: middle; WIDTH: 100px; CURSOR: hand; POSITION: 
  152. absolute; TOP: "+Top+@"px; HEIGHT: 50px; TEXT-ALIGN: center"" 
  153. coordsize=""21600,21600"" arcsize=""4321f"" fillcolor=""#F4A8BD"" receiverName="""" 
  154. receiverID="""" readOnly=""0"" flowFlag=""0"" flowTitle=""<b>0</b><br>"+StepName+@""" 
  155. passCount=""0"" flowType=""end"" is_child_flow=""false"" table_id=""355"" 
  156. inset=""2pt,2pt,2pt,2pt"">
  157. <vml:shadow offset=""3px,3px"" color=""#b3b3b3"" 
  158. type=""single"" on=""T""></vml:shadow>
  159. <vml:textbox onselectstart=""return false;"" 
  160. title="""+Title+@""" 
  161. inset=""1pt,2pt,1pt,1pt""><B>" + ID + @"</B><BR>" + StepName + @"</vml:textbox> 
  162. </vml:roundrect>";
  163.         return PicStr;
  164.     }
  165.     /// <summary>
  166.     /// 画线
  167.     /// </summary>
  168.     /// <param name="source">源</param>
  169.     /// <param name="Object">目标</param>
  170.     /// <returns></returns>
  171.     public string PointerPic(string source,string Object)
  172.     {
  173.         string PicStr = @"<vml:line title="""" 
  174. style=""DISPLAY: none; Z-INDEX: 2; POSITION: absolute"" to=""0,0"" from=""0,0"" 
  175. coordsize=""21600,21600"" arcsize=""4321f"" object=""" + Object + @""" source=""" + source + @""" 
  176. mfrID=""1"">
  177. <vml:stroke endarrow=""block""></vml:stroke>
  178. <vml:shadow offset=""1px,1px"" 
  179. color=""#b3b3b3"" type=""single"" on=""T""></vml:shadow>
  180. </vml:line>";
  181.         return PicStr;
  182.     }
  183. }