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

📄 checkticketin.aspx.cs

📁 可供共享学习.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;
using Botheighten.Yanghui.BusinessFacade;
using Botheighten.Yanghui.Framework;
using Botheighten.Yanghui.BusinessRules;
using Botheighten.Yanghui.Web.Controls;


namespace Botheighten.Yanghui.Web
{
	/// <summary>
	/// CheckTicketIn 的摘要说明。
	/// </summary>
	public class CheckTicketIn : BasePage
	{
		protected System.Web.UI.WebControls.Label lblTitle;
		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 lblCheckOperater2;
		protected System.Web.UI.WebControls.Label lblCheckValue3;
		protected System.Web.UI.WebControls.Label lblCheckOperater3;
		protected System.Web.UI.WebControls.Label lblMessage;
		protected System.Web.UI.WebControls.Button btnPass;
		protected System.Web.UI.WebControls.Button btnGoBack;
		protected System.Web.UI.WebControls.TextBox txtInPrice;
		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)
				{
					//获取成品的单价
					
					this.txtInPrice.Text =BOMSystem.GetPrice(ct.BOMCode).ToString();

					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";
					}

					
					string check="";
					string checkoper="";
					ProductSystem.GetCheckTicketCheckValue(ct.Id,out check,out checkoper);
					if(check=="")
					{
						this.btnPass.Attributes.Add("onClick",@"javascript:return confirm('当前成品还未经过检验\n要强行入库吗?');");
					}
					if(check=="N")
					{
						this.btnPass.Attributes.Add("onClick",@"javascript:return confirm('当前成品检验不合格\n要强行入库吗?');");
					}
				}

			}
		}

		#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.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)
		{
		
			try
			{
				ProductSystem.SaveProduct(this.ViewState["Id"].ToString(),this.CurrentUser().Id,this.txtInPrice.Text);
				
			}
			catch
			{
				this.lblMessage.Text ="失败:在成品入库时遇到错误";
				this.lblMessage.Visible=true;
				return;
			}
			this.btnPass.Visible=false;
			this.lblMessage.Text ="成功:成品入库成功";
			this.lblMessage.Visible=true;
		}


	}
}

⌨️ 快捷键说明

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