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

📄 addflow.aspx.cs

📁 一套完整的OA系统
💻 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;
using System.Data.SqlClient;
using OfficeAuto.Components;

namespace OfficeAuto.DesktopModules.DocumentFlow
{
	/// <summary>
	/// AddFlow 的摘要说明。
	/// </summary>
	public class AddFlow : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Label Label1;
		protected System.Web.UI.WebControls.Label Label3;
		protected System.Web.UI.WebControls.Label Label2;
		protected System.Web.UI.WebControls.RequiredFieldValidator rfFN;
		protected System.Web.UI.WebControls.DropDownList FlowMethodList;
		protected System.Web.UI.WebControls.TextBox FlowDesn;
		protected System.Web.UI.WebControls.Button NextBtn;
		protected System.Web.UI.WebControls.Button CancelBtn;
		protected System.Web.UI.WebControls.TextBox FlowName;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			///判断用户是否登录,否则跳转到登录页面
			if(Session["UserID"] == null)
			{
				Response.Redirect("~/Default.aspx");
			}

			if(!Page.IsPostBack)
			{
				///绑定控件的数据
				BindFlowMethodData();
			}
		}

		private void BindFlowMethodData()
		{
			///获取数据
			FlowMethod method = new FlowMethod();
			SqlDataReader recm = method.GetFlowMethods();

			///绑定数据
			FlowMethodList.DataSource = recm;
			FlowMethodList.DataTextField = "MethodName";
			FlowMethodList.DataValueField = "FlowMethodID";
			FlowMethodList.DataBind();

			recm.Close();
		}

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

		}
		#endregion

		private void CancelBtn_Click(object sender, System.EventArgs e)
		{
			///返回到创建公文流转的起始页面
			Response.Redirect("ViewFlow.aspx");
		}

		private void NextBtn_Click(object sender, System.EventArgs e)
		{
			if(FlowName.Text.Trim().Length > 0)
			{
				///保存公文流转的当前数据
				DocFlowDetails flowDetails = new DocFlowDetails();
				flowDetails.FlowName = FlowName.Text.Trim();
				flowDetails.FlowDesn = FlowDesn.Text.Trim();
				flowDetails.SenderID = Int32.Parse(Session["UserID"].ToString());
				flowDetails.FlowMethodID = Int32.Parse(FlowMethodList.SelectedValue);
				///添加数据到Session中
				Session[Session.SessionID + DocFlowDetails.DocFlowDetail] = flowDetails;

				///下一步
				Response.Redirect("FlowAddDocument.aspx");
			}
		}
	}
}

⌨️ 快捷键说明

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