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

📄 workmod.aspx.cs

📁 ASP.NET的一些开发实例,有论坛管理系统等
💻 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 WorkGroupManager.work
{
	/// <summary>
	/// WorkMod 的摘要说明。
	/// </summary>
	public class WorkMod : WorkGroupManager.WebFormBase
	{
		protected System.Web.UI.WebControls.Label lbTNO;
		protected System.Web.UI.WebControls.Label lbTExcutor;
		protected System.Web.UI.WebControls.TextBox tbEContent;
		protected System.Web.UI.WebControls.Label lbEDate;
		protected System.Web.UI.WebControls.LinkButton datacheck;
		protected Work.WorkService ws=new Work.WorkService();
		protected System.Web.UI.WebControls.CheckBox cbPScan;
		protected Work.work work=new Work.work();
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			this.VerifyPage();
			string[] pks=this.GetCurrentPks(this,true);
			pks[2]=pks[2].Substring(0,pks[2].IndexOf("%"));
			this.work=this.ws.GetWork(pks);
			// 在此处放置用户代码以初始化页面
			if(!Page.IsPostBack)
			{
				this.lbTNO.Text=this.work.tNO;
				this.lbTExcutor.Text=this.work.tExecutor;
				this.lbEDate.Text=this.work.exDate.ToString("yyyy-MM-dd");
				this.tbEContent.Text=this.work.exContent;
//				if(this.work.prScan=="1")
//					this.cbPScan.Checked=true;
//				else if(this.work.prScan=="0")
//					this.cbPScan.Checked=false;
			}
		}

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

		}
		#endregion

		private void datacheck_Click(object sender, System.EventArgs e)
		{
			try
			{
				this.work.tNO=this.lbTNO.Text;
				this.work.tExecutor=this.lbTExcutor.Text;
				this.work.exDate=DateTime.Parse(this.lbEDate.Text);
				//this.work.exContent=this.work.exContent.ToString()+this.tbEContent.Text;
				this.work.exContent=this.tbEContent.Text;
				if(this.cbPScan.Checked==true)
					this.work.prScan="1";
				else
					this.work.prScan="0";
				if(this.ws.ModWork(this.work))
				{
					this.Return(this);	 
				}
				else	
				{
					//使用时将下面代码中的"MainModel_1.aspx"改到特定页面的打开页面的URL
					Response.Write("<script language=javascript>window.opener.location='../Error.aspx?errmsg=工作纪录未能修改成功。';window.close();</script>");  
				}
			}
			catch(Exception ex)
			{
				this.BaseService.Write("工作纪录修改。");
				this.BaseService.Write(ex.Message);
			}
		}
	}
}

⌨️ 快捷键说明

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