コード例 #1
0
        private void load_products()
        {
            productid.Clear();
            quantity.Clear();
            price.Clear();
            HttpCookie myCookies = Request.Cookies["myCookieId"];
            string     user_id   = myCookies["userid"];

            string[] products = myservice.product_list(user_id, "", "");
            string[] qty      = myservice.quantity(user_id, "", "");

            for (int x = 0; x < products.Length; x++)
            {
                productid.AddLast(products[x]);
                quantity.AddLast(Convert.ToInt32(qty[x]));
                string display = "Products: " + products[x] + " Quantity: " + qty[x];
                ListBox1.Items.Add(display);
            }

            for (int x = 0; x < productid.Count; x++)
            {
                string[] data = myservice.book_details(productid.ElementAt(x), "", "");
                price.AddLast(Convert.ToDouble(data[5]));
            }

            double total_price = 0;

            for (int x = 0; x < productid.Count; x++)
            {
                total_price += (quantity.ElementAt(x) * price.ElementAt(x));
            }

            Label3.Text = Convert.ToString(total_price);
        }
コード例 #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (DropDownList1.SelectedValue == "Books")
     {
         productid.Clear();
         quantity.Clear();
         ListBox1.Items.Clear();
         string[] items = myservice.search_books(DropDownList2.SelectedValue, TextBox1.Text, "", "");
         for (int x = 0; x < items.Length; x++)
         {
             string[] data       = myservice.book_details(items[x], "", "");
             string   product_id = data[0];
             productid.AddLast(data[0]);
             string isbn    = data[1];
             string title   = data[2];
             string subject = data[3];
             string qty     = data[4];
             quantity.AddLast(Convert.ToInt32(data[4]));
             string   price        = data[5];
             string   bidding      = data[6];
             string[] info         = myservice.get_user_info(data[7], "", "");
             string   seller_name  = info[2];
             string   seller_email = info[3];
             string   result       = "Product ID: " + product_id + " Quantity: " + qty + " Price: " + price + " Bidding: " + bidding;
             ListBox1.Items.Add(result);
         }
     }
 }
コード例 #3
0
        private void load_products()
        {
            HttpCookie myCookies = Request.Cookies["myCookieId"];
            string     user_id   = myCookies["userid"];

            productid.Clear();

            string[] items = myservice.list_products(user_id, "", "");

            for (int x = 0; x < items.Length; x++)
            {
                string[] data       = myservice.book_details(items[x], "", "");
                string   product_id = data[0];
                productid.AddLast(data[0]);
                string   isbn         = data[1];
                string   title        = data[2];
                string   subject      = data[3];
                string   quantity     = data[4];
                string   price        = data[5];
                string   bidding      = data[6];
                string[] info         = myservice.get_user_info(data[7], "", "");
                string   seller_name  = info[2];
                string   seller_email = info[3];
                string   result       = "Product ID: " + product_id + " Quantity: " + quantity + " Price: " + price + " Bidding: " + bidding;
                ListBox1.Items.Add(result);
            }
        }
コード例 #4
0
        private void load_products()
        {
            productid.Clear();
            quantity.Clear();
            price.Clear();
            HttpCookie myCookies = Request.Cookies["myCookieId"];
            string     user_id   = myCookies["userid"];

            string[] products = myservice.product_list(user_id, "", "");
            string[] qty      = myservice.quantity(user_id, "", "");


            for (int x = 0; x < products.Length; x++)
            {
                productid.AddLast(products[x]);
                quantity.AddLast(Convert.ToInt32(qty[x]));
            }

            for (int x = 0; x < productid.Count; x++)
            {
                string[] data = myservice.book_details(productid.ElementAt(x), "", "");
                price.AddLast(Convert.ToDouble(data[5]));
            }

            for (int x = 0; x < productid.Count; x++)
            {
                TextBox1.Text += "Products: " + productid.ElementAt(x) + " Quantity: " + quantity.ElementAt(x) + " Price: " + price.ElementAt(x) + "\n";
            }
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie myCookies = Request.Cookies["myCookieId"];

            if ((myCookies == null) || (myCookies["userid"] == ""))
            {
                Response.Redirect("default1.aspx");
            }

            // Label2.Text = account.edit_product;
            product_id = account.edit_product;//set product_id



            string[] data     = service.book_details(product_id, "", "");
            string   prod_id  = data[0];
            string   isbn     = data[1];
            string   title    = data[2];
            string   subject  = data[3];
            string   quantity = data[4];
            string   price    = data[5];
            string   bidding  = data[6];

            string[] info         = service.get_user_info(data[7], "", "");
            string   seller_name  = info[2];
            string   seller_email = info[3];

            Label2.Text   = prod_id;
            TextBox2.Text = isbn;
            TextBox3.Text = title;
            TextBox4.Text = subject;
            TextBox8.Text = quantity;
            TextBox6.Text = price;
            TextBox7.Text = bidding;
            Label3.Text   = seller_name;
            Label4.Text   = seller_email;
        }