⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 streamdetail.aspx.cs

📁 很不错的公文流转系统
💻 CS
字号:
using System; 
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace OI.desktop
{
	/// <summary>
	/// StreamDetail 的摘要说明。
	/// </summary>
	public class StreamDetail : OI.PageBase
	{
		protected System.Web.UI.WebControls.Label lStreamName;
		protected System.Web.UI.WebControls.Label Label_Alert;
		protected System.Web.UI.WebControls.Label LabelStream;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			if (Session["userid"]==null)
			{
				Response.Write ("<script>alert('超时,请重新登录');top.location.href='../userpass.aspx';</script>");
				return ;
			}
			if(this.IsPostBack)
				return;
			int streamID=0;
			string DocumentID = "";
			Label_Alert.Text="";
			
			if (Request.QueryString["DocumentID"] != null)
				DocumentID=Request.QueryString["DocumentID"].ToString();
//			}
//			catch
//			{
//				Response.Write("<script language=javascript>\n alert(\"未找到此工作流,请检查地址栏传入的参数是否正确\");\n history.back(); \n</script>");
//				Response.End();
//			}

			//若DocumentID 未传过来则直接取 streamID 参数
			if (DocumentID != "")
			{
				OI.DatabaseOper.DatabaseConnect oConn = new OI.DatabaseOper.DatabaseConnect();
				string szSql = "select streamID from document where documentID=" + DocumentID;
				streamID = System.Int32.Parse( oConn.GetValueBySql(szSql));
			}
			else
			{
				if (Request.QueryString["StreamID"] != null)
					streamID = int.Parse(Request.QueryString["StreamID"].ToString());
				if (streamIsUsing(streamID))
					Label_Alert.Text = "(有文档正在使用该流程,所以不能更改,只能查看!)";
			}
            
			this.dataInit(streamID);			
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="streamID"></param>
		/// <returns></returns>
		public bool streamIsUsing(int streamID)
		{  
			bool returnvalue=false;
			try
			{
				OI.cs .readStream rs=new OI.cs.readStream ();
				rs.StreamID =streamID;
				int stepid= int.Parse ( rs.GetNodeIdByType ("公文起草"));
			 
				string sql="select  CurrentStepID from document where StreamID="+streamID;
				OI.DatabaseOper .DatabaseConnect Dbc =new OI.DatabaseOper.DatabaseConnect ();
				ArrayList CurrentStepIDs= Dbc.getData (sql);
				foreach ( object o in CurrentStepIDs)
				{  
					int step=int.Parse (o.ToString ());
					if (step !=stepid  )
					{
						returnvalue=true;
						break;
					}
				}
			}
			catch
			{
			}
			return returnvalue ;
		}
		private void dataInit(int streamID)
		{

			OI.cs.readStream oReadStream = new OI.cs.readStream();
			OI.Data.Streams.Stream dataStream=new OI.Data.Streams.Stream();
			if(dataStream.Search(streamID))
			{
				this.lStreamName.Text=dataStream.StreamName;
			}
			else
			{
				Response.Write("<script language=javascript>\n alert(\"未找到此工作流,请检查地址栏传入的参数是否正确\");\n history.back(); \n</script>");
				Response.End();
			}
			this.LabelStream.Text="<table align=\"center\" width=\"50%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";

			OI.Business.Stream oStream=new OI.Business.Stream(dataStream.StreamDef);
			foreach(OI.Business.Stream.Node oNode in oStream.NodeIdList())
			{
				//Handers
				string mHanders="";
				string[] handers=OI.Modules.Module.UserName(oNode.Handers);				
				for(int i=0;i<handers.Length;i++)
				{
					if(mHanders=="")
						mHanders+=handers[i];
					else
						mHanders+=" "+handers[i];
				}

				switch(oNode.NodeTypeName)
				{
					case "开始":
						//显示公文开始
						this.LabelStream.Text+="<tr>\n";
						this.LabelStream.Text+="	<td width=\"100%\" ><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" style=\"BORDER-COLLAPSE:collapse; BACKGROUND-COLOR:'LightGoldenrodYellow'\">\n";
						this.LabelStream.Text+="			<tr>\n";
						this.LabelStream.Text+="				<td nowrap align=\"center\" style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\">公文办理开始</td>\n";
						this.LabelStream.Text+="			</tr>\n";
						this.LabelStream.Text+="		</table>\n";
						this.LabelStream.Text+="	</td>\n";
						this.LabelStream.Text+="</tr>\n";
						//显示箭头
						this.LabelStream.Text+="<tr>\n";
						this.LabelStream.Text+="	<td width=\"100%\" ><table width=\"100%\"border=\"0\" cellspacing=\"0\" cellpadding=\"2\" style=\"BORDER-COLLAPSE:collapse BACKGROUND-COLOR:LightGoldenrodYellow\">\n";
						this.LabelStream.Text+="			<tr style=\"BACKGROUND-COLOR:#ffffff\">\n";
						this.LabelStream.Text+="				<td align=\"right\" width=\"50%\"><b>↓</b></td>\n";
//						this.LabelStream.Text+="				<td align=\"left\" width=\"50%\" nowrap></td>\n";//modified
						this.LabelStream.Text+="				<td></td>\n";
						this.LabelStream.Text+="			</tr>\n";
						this.LabelStream.Text+="		</table>\n";
						this.LabelStream.Text+="	</td>\n";
						this.LabelStream.Text+="</tr>\n";
						break;
					case "结束":
						this.LabelStream.Text+="<tr>\n";
						this.LabelStream.Text+="	<td width=\"100%\" ><table width=\"100%\"border=\"0\" cellspacing=\"0\" cellpadding=\"2\" style=\"BORDER-COLLAPSE:collapse;BACKGROUND-COLOR:'LightGoldenrodYellow'\">\n";
						this.LabelStream.Text+="			<tr>\n";
						this.LabelStream.Text+="				<td nowrap align=\"center\" style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\">公文流程结束</td>\n";
						this.LabelStream.Text+="			</tr>\n";
						this.LabelStream.Text+="		</table>\n";
						this.LabelStream.Text+="	</td>\n";
						this.LabelStream.Text+="</tr>\n";
						break;
					default:
						this.LabelStream.Text+="<tr>\n";
						this.LabelStream.Text+="	<td width=\"100%\" >\n";
						this.LabelStream.Text+="		<table width=\"100%\"style=\"BORDER-COLLAPSE:collapse\" border=\"0\"\n";
						this.LabelStream.Text+="			cellspacing=\"0\" cellpadding=\"2\">\n";
						this.LabelStream.Text+="			<tr bgcolor='FloralWhite'>\n";
						this.LabelStream.Text+="				<td colspan=\"2\" nowrap align=\"center\" width=\"120\" style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\"><b>"+oNode.NodeTypeName+"</b></td>\n";
						this.LabelStream.Text+="			</tr>\n";
						this.LabelStream.Text+="			<tr>\n";
						this.LabelStream.Text+="				<td width=\"30%\" style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\">办理人员说明:</td>\n";
						this.LabelStream.Text+="				<td width=\"70%\" style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\">"+oNode.HanderDescription+"</td>\n";
						this.LabelStream.Text+="			</tr>\n";

					
						
						
						
						
						
						this.LabelStream.Text+="			<tr bgcolor='FloralWhite'>\n";
						this.LabelStream.Text+="				<td style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\">工作点流转方式:</td>\n";
						this.LabelStream.Text+="				<td style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\">\n"; 
						if(oNode.FlowType==OI.Business.Stream.Node.FlowTypes.AnyOne)
							this.LabelStream.Text+="					任何一人完成继续&nbsp;\n";
						else
							this.LabelStream.Text+="					全部完成继续&nbsp;\n";
						this.LabelStream.Text+="				</td>\n";
						this.LabelStream.Text+="			</tr>\n";
						this.LabelStream.Text+="			<tr>\n";
						this.LabelStream.Text+="				<td style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\">办理人员列表:</td>\n";
						this.LabelStream.Text+="				<td style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\">"+mHanders+"</td>\n";
						this.LabelStream.Text+="			</tr>\n";

						this.LabelStream.Text+="			<tr bgcolor='FloralWhite'>\n";
						this.LabelStream.Text+="				<td width=\"30%\" style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\">办理时限(天):</td>\n";
						this.LabelStream.Text+="				<td width=\"70%\" style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\">"+oNode.Time+"</td>\n";
						this.LabelStream.Text+="			</tr>\n";

						
						
						
						//						this.LabelStream.Text+="			<tr bgcolor='FloralWhite'>\n";
//						this.LabelStream.Text+="				<td colspan=\"2\" style=\"BORDER-RIGHT:#000000 1px solid; BORDER-TOP:#000000 1px solid; BORDER-LEFT:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid\">\n";
//
//						if(oNode.CanDisAgree)
//							this.LabelStream.Text+="<font color='green'>√退签</font>&nbsp;";
//						else
//							this.LabelStream.Text+="<font color='red'>×退签</font>&nbsp;";
//						if(oNode.CanCheck)
//							this.LabelStream.Text+="<font color='green'>√批改</font>&nbsp;";
//						else
//							this.LabelStream.Text+="<font color='red'>×批改</font>&nbsp;";
//						if(oNode.CanRefuse)
//							this.LabelStream.Text+="<font color='green'>√撤销</font>&nbsp;";
//						else
//							this.LabelStream.Text+="<font color='red'>×撤销</font>&nbsp;";
//						this.LabelStream.Text+="				</td>\n";
//						this.LabelStream.Text+="			</tr>\n";
						this.LabelStream.Text+="			<tr style=\"BACKGROUND-COLOR:#ffffff\">\n";
						this.LabelStream.Text+="				<td align=\"right\" width=\"50%\"><b>↓</b></td>\n";
//						this.LabelStream.Text+="				<td align=\"left\" width=\"50%\" nowrap>←<a href=\"AddNode.aspx?StreamID="+streamID.ToString()+"&NodeID="+oNode.NodeId.ToString()+"\" class=\"LinkText\">插入工作点</a>\n";
						this.LabelStream.Text+="				<td></td>\n";
						this.LabelStream.Text+="			</tr>\n";
						this.LabelStream.Text+="		</table>\n";
						this.LabelStream.Text+="	</td>\n";
						this.LabelStream.Text+="</tr>\n";
						break;
				}


				




			}
			this.LabelStream.Text+="</table>\n";
			
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -