📄 checkticketcheck.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;
using Botheighten.Yanghui.BusinessFacade;
using Botheighten.Yanghui.Framework;
using Botheighten.Yanghui.BusinessRules;
using Botheighten.Yanghui.Web.Controls;
namespace Botheighten.Yanghui.Web
{
/// <summary>
/// CheckTicketCheck 的摘要说明。
/// </summary>
public class CheckTicketCheck : BasePage
{
protected System.Web.UI.WebControls.Label lblTitle;
protected System.Web.UI.WebControls.Label lblMessage;
protected System.Web.UI.WebControls.Button btnGoBack;
protected System.Web.UI.WebControls.Button btnPass;
protected System.Web.UI.WebControls.Button btnReject;
protected System.Web.UI.WebControls.Label lblCheckValue1;
protected System.Web.UI.WebControls.Label lblCheckOperater1;
protected System.Web.UI.WebControls.Label lblCheckValue2;
protected System.Web.UI.WebControls.Label lblCheckValue3;
protected System.Web.UI.WebControls.Label lblCheckOperater2;
protected System.Web.UI.WebControls.Label lblCheckOperater3;
protected CheckTicket_C CheckTicket_C1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
Principal p=this.CurrentUser();
this.CheckPermissionPage(p.Id,"","601");
this.ReponseWriteDeleteScript ();
this.lblMessage.Visible=false;
if(!Page.IsPostBack)
{
string ctid="";
if(Request.QueryString["Id"]!=null)
ctid=Request.QueryString["Id"].ToString();
this.CheckTicket_C1.RID=ctid;
this.CheckTicket_C1.Bind();
this.ViewState["Id"]=ctid;
CheckTicket ct=new CheckTicket();
ct.Id=ctid;
ct.Retrieve();
this.ViewState["Index"]="0";
if(ct.IsPersistent)
{
if(ct.CheckValue1!=null && ct.CheckValue1!="")
{
this.lblCheckValue1.Text += ct.CheckValue1=="Y"?"合格":"不合格";
this.lblCheckOperater1.Text +=ct.CheckOperater1;
this.ViewState["Index"]="1";
}
if(ct.CheckValue2!=null && ct.CheckValue2!="")
{
this.lblCheckValue2.Text += ct.CheckValue2=="Y"?"合格":"不合格";
this.lblCheckOperater2.Text +=ct.CheckOperater2;
this.ViewState["Index"]="2";
}
if(ct.CheckValue3!=null && ct.CheckValue3!="")
{
this.lblCheckValue3.Text += ct.CheckValue3=="Y"?"合格":"不合格";
this.lblCheckOperater3.Text +=ct.CheckOperater3;
this.ViewState["Index"]="3";
}
}
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.btnPass.Click += new System.EventHandler(this.btnPass_Click);
this.btnReject.Click += new System.EventHandler(this.btnReject_Click);
this.btnGoBack.Click += new System.EventHandler(this.btnGoBack_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnGoBack_Click(object sender, System.EventArgs e)
{
Response.Redirect("CheckTicketWeb.aspx",true);
}
private void btnPass_Click(object sender, System.EventArgs e)
{
CheckTicket ct=new CheckTicket();
ct.Id=this.ViewState["Id"].ToString();
ct.Retrieve();
string u=this.CurrentUser().Id;
if(ct.IsPersistent)
{
ct.CheckDate=System.DateTime.Now;
if(this.ViewState["Index"].ToString()=="0")
{
ct.CheckValue1="Y";
ct.CheckOperater1=u;
ct.CheckDate1=System.DateTime.Now;
SaveCheck(ct);
}
if(this.ViewState["Index"].ToString()=="1")
{
ct.CheckValue2="Y";
ct.CheckOperater2=u;
ct.CheckDate2=System.DateTime.Now;
SaveCheck(ct);
}
if(this.ViewState["Index"].ToString()=="2")
{
ct.CheckValue3="Y";
ct.CheckOperater3=u;
ct.CheckDate3=System.DateTime.Now;
SaveCheck(ct);
}
if(this.ViewState["Index"].ToString()=="3")
{
this.lblMessage.Text ="失败:已经有三人进行检验,您将无法再进行检验";
this.lblMessage.Visible=true;
return;
}
}
}
private void SaveCheck(CheckTicket ct)
{
ct.Flag="Y";
ct.Save();
this.lblMessage.Text ="成功:检验操作成功";
this.lblMessage.Visible=true;
this.btnPass.Visible=false;
this.btnReject.Visible=false;
return;
}
private void btnReject_Click(object sender, System.EventArgs e)
{
CheckTicket ct=new CheckTicket();
ct.Id=this.ViewState["Id"].ToString();
ct.Retrieve();
string u=this.CurrentUser().Id;
if(ct.IsPersistent)
{
ct.CheckDate=System.DateTime.Now;
if(this.ViewState["Index"].ToString()=="0")
{
ct.CheckValue1="N";
ct.CheckOperater1=u;
SaveCheck(ct);
}
if(this.ViewState["Index"].ToString()=="1")
{
ct.CheckValue2="N";
ct.CheckOperater2=u;
SaveCheck(ct);
}
if(this.ViewState["Index"].ToString()=="2")
{
ct.CheckValue3="N";
ct.CheckOperater3=u;
SaveCheck(ct);
}
if(this.ViewState["Index"].ToString()=="3")
{
this.lblMessage.Text ="失败:已经有三人进行检验,您将无法再进行检验";
this.lblMessage.Visible=true;
return;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -