Ejemplo n.º 1
0
    protected void btnaddcat_Click(object sender, EventArgs e)
    {
        if (txtaddcat.Text == "")
        {
            showlbl.Text = "Please Enter Category Name";
        }
        else
        {
            p.addcat = txtaddcat.Text;
            int count = obj.count(p);



            if (count > 0)
            {
                showlbl.Text = "The Category Already Exits";
            }
            else
            {
                p.CatName = txtaddcat.Text;
                bool b = obj.bll_insert(p);

                if (b == true)

                {
                    showlbl.Text = "Insert Successfully";
                }
                else
                {
                    showlbl.Text = "not Insert Successfully";
                }
                // Response.Redirect(Request.Url.AbsoluteUri); // creating problem in ajax
            }
        }
    }