Exemple #1
0
        //OleDbDataAdapter adp = new OleDbDataAdapter ("select zipcode from address where address_id=(select billing_address_id from customer where customer_id=?", cn);
        //adp.SelectCommand.Parameters.AddWithValue("?", Session["Name"]);



        protected void Button1_Click(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            {
                string a = Request.QueryString["v1"].ToString();
                // Session["User"] = Session["Name"].ToString();

                string m = "0";
                for (int i = 0; i < gvdata.Rows.Count; i++)
                {
                    RadioButton rb = (gvdata.Rows[i].FindControl("rdbUser")) as RadioButton;
                    if (rb.Checked == true)
                    {
                        m = gvdata.Rows[i].Cells[1].Text;
                    }
                }
                updateproduct.Service1SoapClient x = new updateproduct.Service1SoapClient();

                // int z = x.product_service(a, m, (Convert.ToInt32(Session["Name"])));
                int z = 0;
                if (z == 1)
                {
                    Response.Redirect("Displayproductupdate.aspx");
                }
                else
                {
                    Response.Redirect("displayproductupdatefail.aspx");
                }
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string a = Request.QueryString["v1"].ToString();
            string b = Request.QueryString["v2"].ToString();

            productlist.GetAllProductsSoapClient s  = new productlist.GetAllProductsSoapClient();
            productlist.ProductClass[]           pc = s.GetProductsByZipAndServiceID(a, int.Parse(b));
            updateproduct.Service1SoapClient     x  = new updateproduct.Service1SoapClient();
            string k = pc[0].Product_ID;
            int    i = x.product_service(a, product_id.Text, 22);

            if (product_id.Text == k)
            {
                if (i == 1)
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert(' Your Service is updated.Have a nice day')", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('Sorry Server is down.Will try to reach you')", true);
                }
            }


            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert(' You Entered incorrect product Id,Please Check ')", true);
            }
        }