protected void Page_Load(object sender, EventArgs e) { string EbayId = Session["productid"].ToString(); Ebayimg.ImageUrl = "~/Websiteimages/" + EbayId + ".jpg"; Ebaywebservice.EbayService obj = new Ebaywebservice.EbayService(); Ebaywebservice.Ebaydetails Ebinfo = obj.methodEbayinfo(EbayId); lblEbayID.Text = Ebinfo.method_EbayProdID; lblEbayModel.Text = Ebinfo.method_EbayProdModel; lblEbayType.Text = Ebinfo.method_EbayProdType; lblEbayName.Text = Ebinfo.method_EbayProdName; lblEbayPrice.Text = Ebinfo.method_EbayProdPrice; lblEbaySpec.Text = Ebinfo.method_EbayProdSpec; }
protected void btnSearch_Click(object sender, EventArgs e) { Session["productid"] = txtWEBID.Text; string ProductID = Session["productid"].ToString(); //SqlConnection Amazconn = new SqlConnection(ConfigurationManager.ConnectionStrings["Amazondatabase"].ConnectionString); //Amazconn.Open(); //SqlCommand cmd = new SqlCommand("Select product_price from product_details where product_id = '" + ProductID + "'", Amazconn); //SqlDataReader reader = cmd.ExecuteReader(); //reader.Read(); //String Amazonprice = reader[0].ToString(); Amazonwebservice.Amazonservice AMAZobj = new Amazonwebservice.Amazonservice(); AMAZobj.Credentials = System.Net.CredentialCache.DefaultCredentials; Amazonwebservice.Amazondetails Amadetails = AMAZobj.methodAMAZdetails(ProductID); BBuyWebservice.BestBuyService BBUYobj = new BBuyWebservice.BestBuyService(); BBuyWebservice.BestBuydetails Bbuydetails = BBUYobj.methodBBUYdetails(ProductID); Ebaywebservice.EbayService Ebayobj = new Ebaywebservice.EbayService(); Ebaywebservice.Ebaydetails Ebinfo = Ebayobj.methodEbayinfo(ProductID); String Amazonpprice, BBuypprice, Ebaypprice; Amazonpprice = Amadetails.method_AMAZProdprice; BBuypprice = Bbuydetails.method_BBUYProdprice; Ebaypprice = Ebinfo.method_EbayProdPrice; int Amp = Int32.Parse((Amazonpprice)); int BBp = Int32.Parse((BBuypprice)); int Ebp = Int32.Parse((Ebaypprice)); if (Amp < BBp) { if (Amp < Ebp) { Response.Redirect("Amazon_main.aspx"); } else if (Ebp < BBp) { Response.Redirect("Ebaymain.aspx"); } else { Response.Redirect("BestBuysite.aspx"); } } else { if (BBp < Ebp) { Response.Redirect("BestBuysite.aspx"); } else { Response.Redirect("Ebaymain.aspx"); } } }