editflowmethod.aspx.cs

来自「本系统以采用一种结合B/S和Web的方式开发的中小企业办公自动化系统为例讨论办公」· CS 代码 · 共 102 行

CS
102
字号
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>
	/// EditFlowMethod 的摘要说明。
	/// </summary>
	public partial class EditFlowMethod : System.Web.UI.Page
	{

		private int nFlowMethodID = 0;
	
		protected void Page_Load(object sender, System.EventArgs e)
		{
			///判断用户是否登录,否则跳转到登录页面
			if(Session["UserID"] == null)
			{
				Response.Redirect("~/Default.aspx");
			}

			if(Request.Params["FlowMethodID"] != null)
			{
				///获取方式的ID
				nFlowMethodID = Int32.Parse(Request.Params["FlowMethodID"].ToString());
			}
			if(!Page.IsPostBack)
			{
				if(nFlowMethodID > 0)
				{
					///绑定控件的数据
					BindFlowMethodData(nFlowMethodID);
				}
			}
		}

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

			if(recm.Read())
			{
				///读取数据
				FlowName.Text = recm["MethodName"].ToString();
				FlowDesn.Text = recm["MethodDesn"].ToString();
			}
			recm.Close();
		}

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

		}
		#endregion

		protected void SureBtn_Click(object sender, System.EventArgs e)
		{
			if(FlowName.Text.Trim().Length > 0)
			{
				///提交修改
				FlowMethod method = new FlowMethod();
				method.UpdateFlowMethod(nFlowMethodID,FlowName.Text.Trim(),FlowDesn.Text.Trim());
				
				///修改后返回
				Response.Write("<script language=javascript>alert('公文流转方式提交成功!');</script>");
			}
		}

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

⌨️ 快捷键说明

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