Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string AMAZID = Session["productid"].ToString();
     AMAZimage.ImageUrl = "~/Websiteimages/" + AMAZID + ".jpg";
     Amazonwebservice.Amazonservice obj1 = new Amazonwebservice.Amazonservice();
     obj1.Credentials = System.Net.CredentialCache.DefaultCredentials;
     Amazonwebservice.Amazondetails details = obj1.methodAMAZdetails(AMAZID);
     lblAPId.Text = details.method_AMAZProdid;
     lblAPModel.Text = details.method_AMAZProdmodel;
     lblAPName.Text = details.method_AMAZProdtype;
     lblAPType.Text = details.method_AMAZProdname;
     lblAPPrice.Text = details.method_AMAZProdprice;
 }
 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");
         }
     }
 }