private void UpdateType(ProdClass proClass) { ProdClassManager proClassBLL = new ProdClassManager(); if (proClassBLL.Update(proClass)) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('修改成功')</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('修改失败')</script>"); } }
private void AddType(ProdClass proClass) { if (ExistNum(txtTypeNum.Text)) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('编号已存在')</script>"); return; } ProdClassManager proClassBLL = new ProdClassManager(); if (proClassBLL.Add(proClass)) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('添加成功')</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('添加失败')</script>"); } }
private void Save() { ProdClass proClass = new ProdClass(); proClass.Prior = 0;//暂时无用 proClass.ProdClassName = txtTypeName.Text; proClass.ProdClassNo = txtTypeNum.Text; proClass.ViewInReport = false;//暂时无用 switch (HidCmdName.Value) { case "ADD": AddType(proClass); break; case "MODIFY": UpdateType(proClass); break; default: break; } }