示例#1
0
        protected void btnUpdatePT_Click(object sender, EventArgs e)
        {
            int    PTID   = 1;
            string PTName = txtName.Text;
            string PTDesc = txtDesc.Text;

            if (PTName != null && PTDesc != null)
            {
                if (PTName.Length > 5)
                {
                    if (PTRepository.getName(PTName) != null)
                    {
                        alrExists.Visible = true;
                    }
                    else
                    {
                        PTRepository.updateProductType(PTID, PTName, PTDesc);

                        txtName.Text = txtDesc.Text = "";

                        Response.Redirect("Update PT.aspx");
                    }
                }
                else
                {
                    txtNameLen.Visible = true;
                }
            }
        }
示例#2
0
        protected void btnInsertPT_Click(object sender, EventArgs e)
        {
            int    PTID   = 1;
            string PTName = txtName.Text;
            string PTDesc = txtDesc.Text;

            if (PTName.Length > 5 && PTRepository.getName(PTName) == null)
            {
                PTRepository.createProductType(PTID, PTName, PTDesc);

                success.Visible = true;

                txtName.Text = txtDesc.Text = "";
            }
            else
            {
                txtNameLen.Visible = true;
            }
        }