예제 #1
0
        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>");
            }
        }
예제 #2
0
        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>");
            }
        }
예제 #3
0
        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;
            }
        }