📄 workpmod.aspx.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>
/// WorkPMod 的摘要说明。
/// </summary>
public class WorkPMod : 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 lbPromulgator;
protected System.Web.UI.WebControls.TextBox tbPDate;
protected System.Web.UI.WebControls.TextBox tbPContent;
protected System.Web.UI.WebControls.RangeValidator RangeValidator1;
protected System.Web.UI.WebControls.Label lbEDate;
protected System.Web.UI.WebControls.CheckBox cbEScan;
protected System.Web.UI.WebControls.LinkButton datacheck;
protected Work.WorkService ws=new Work.WorkService();
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;
this.lbPromulgator.Text=this.work.tPromulgator;
if(System.DateTime.Equals(this.work.prDate,Convert.ToDateTime("1900-1-1")))
this.tbPDate.Text=System.DateTime.Now.ToString("yyyy-MM-dd");
else
this.tbPDate.Text=System.DateTime.Now.ToString("yyyy-MM-dd");
this.tbPContent.Text=this.work.prContent;
// if(this.work.exScan=="1")
// this.cbEScan.Checked=true;
// else if(this.work.exScan=="0")
// this.cbEScan.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.tbEContent.Text;
this.work.tPromulgator=this.lbPromulgator.Text;
this.work.prDate=DateTime.Parse(this.tbPDate.Text);
this.work.prContent=this.tbPContent.Text;
//this.work.prContent=this.work.prContent+this.tbPContent.Text;
if(this.cbEScan.Checked==true)
this.work.exScan="1";
else
this.work.exScan="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 + -