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

📄 addflowmethod.aspx.cs

📁 ASP C#代码实例 适合初学人士学习使用
💻 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>
	/// AddFlowMethod 的摘要说明。
	/// </summary>
	public class AddFlowMethod : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Label Label1;
		protected System.Web.UI.WebControls.TextBox FlowName;
		protected System.Web.UI.WebControls.RequiredFieldValidator rfFN;
		protected System.Web.UI.WebControls.Label Label2;
		protected System.Web.UI.WebControls.TextBox FlowDesn;
		protected System.Web.UI.WebControls.Button SureBtn;
		protected System.Web.UI.WebControls.Button CancelBtn;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			///判断用户是否登录,否则跳转到登录页面
			if(Session["UserID"] == null)
			{
				Response.Redirect("~/Default.aspx");
			}
		}

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

		}
		#endregion

		private void SureBtn_Click(object sender, System.EventArgs e)
		{
			if(FlowName.Text.Trim().Length > 0)
			{
				///添加新的公文流转方式
				FlowMethod method = new FlowMethod();
				if(method.AddFlowMethod(FlowName.Text.Trim(),FlowDesn.Text.Trim()) > 0)
				{ 
					Response.Write("<script language=javascript>alert('公文流转方式提交成功!');</script>");
				}
				else
				{
					Response.Write("<script language=javascript>alert('公文流转方式提交失败!');</script>");
				}
			}
		}

		private void CancelBtn_Click(object sender, System.EventArgs e)
		{
			///跳转到公文流转方式管理页面
			Response.Redirect("~/DesktopModules/DocumentFlow/FMethodManage.aspx");
		}
	}
}

⌨️ 快捷键说明

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