MatCodeAdd.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:2k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using com.etong.BusinessRule.MatCode;
- public partial class MatCode_MatCodeAdd : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void BT_Confirm_Click(object sender, EventArgs e)
- {
- string matcode = this.TB_MatCode.Text;
- string matname = this.TB_MatName.Text;
- string matdecs = this.TB_MatDecs.Text;
- MatCode mymatcode = new MatCode();
- bool flag = mymatcode.MatCodeCheck(matcode);
- if (flag == false)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:此物资代码格式错误!');</script>");
- return;
- }
- DataView dv = mymatcode.MatCodeSearch(matcode, "1");
- if (dv.Count > 0)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:此物资已经存在!');</script>");
- return;
- }
- bool returnvalue = false;
- returnvalue = mymatcode.MatCodeAdd(matcode, matname, matdecs);
- if (returnvalue)
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:添加记录成功!');</script>");
- else
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:添加记录不成功!');window.close();</script>");
- this.TB_MatCode.Text = "";
- this.TB_MatDecs.Text = "";
- this.TB_MatName.Text = "";
- }
- }