示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["buyerID"] = Session["userID"].ToString();
            functions function = new functions();

            function.call_products(products_box);
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int returnId = Convert.ToInt16(Session["userID"].ToString());

            // Entity object
            ElectroDBEntities db             = new ElectroDBEntities();
            functions         user_functions = new functions();
            var review = from c in db.customers where c.cust_ID == returnId select c;

            var userss = review.FirstOrDefault();

            if (userss.cust_img != null)
            {
                Image1.ImageUrl = user_functions.image_retrive(userss.cust_ID);
            }
            user_id_label.Text  = userss.cust_ID.ToString();
            username_label.Text = userss.username;
            fullName_label.Text = userss.f_name + " " + userss.l_name;
            DB_label.Text       = userss.b_date.ToString();
            email_label.Text    = userss.gender;
            if (userss.is_seller == true)
            {
                customer_type.Text = "Seller";
            }
            if (userss.is_seller == false)
            {
                customer_type.Text = "Buyer";
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ElectroDBEntities db  = new ElectroDBEntities();
            functions         fun = new functions();
            int buyerid           = Convert.ToInt16(Session["userID"].ToString());
            var shippings         = db.shipping_card;

            foreach (var shipping in shippings)
            {
                if (shipping.buyer_ID == buyerid)
                {
                    call_shippings(shipping.p_ID, shipping.ID);
                }
            }
        }
示例#4
0
        protected void login_btn_Click(object sender, EventArgs e)
        {
            var myUser = new customer
            {
                username = user_name.Text,

                pass = pass.Text
            };

            functions login_fun = new functions();

            if (login_fun.login(myUser) == 0)
            {
                alert.Attributes.Remove("hidden");
            }
            else if (login_fun.login(myUser) == 1)
            {
                Response.Redirect("buyerPage.aspx");
            }
            else
            {
                Response.Redirect("sellerPage.aspx");
            }
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            functions functions = new functions();

            functions.call_microwaves(microwave_box);
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            functions functions = new functions();

            functions.call_seller_products(home);
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            functions functions = new functions();

            functions.call_laptops(laptop_box);
        }
示例#8
0
        public void call_shippings(int id, int shID)
        {
            ElectroDBEntities db  = new ElectroDBEntities();
            functions         fun = new functions();
            var products          = db.products;

            foreach (var product in products)
            {
                if (product.p_ID == id)
                {
                    TextBox input = new TextBox();

                    total_price += product.p_price;
                    TableRow  tr = new TableRow();
                    TableCell th = new TableCell();


                    HtmlGenericControl row = new HtmlGenericControl("div");
                    row.Attributes["class"] = "row";

                    HtmlGenericControl colsm2 = new HtmlGenericControl("div");
                    colsm2.Attributes["class"] = "col-sm-2 hidden-xs";

                    HtmlGenericControl img = new HtmlGenericControl("img");
                    img.Style.Add(HtmlTextWriterStyle.Width, "100px");
                    img.Style.Add(HtmlTextWriterStyle.Height, "80px");
                    img.Attributes["class"] = "img-responsive";
                    img.Attributes["src"]   = fun.itemImage_retrive(product.p_ID);

                    HtmlGenericControl colsm10 = new HtmlGenericControl("div");
                    colsm10.Attributes["class"] = "col-sm-10";

                    HtmlGenericControl h4 = new HtmlGenericControl("h4");
                    h4.Attributes["class"] = "nomargin";
                    h4.InnerText           = product.p_name;

                    HtmlGenericControl p = new HtmlGenericControl("p");
                    p.InnerText = product.p_desc;
                    //////////////////////////////////////////////////////
                    TableCell td = new TableCell();
                    td.Attributes["data-th"] = "Price";
                    td.Text = product.p_price.ToString();


                    TableCell td2 = new TableCell();
                    td2.Attributes["data-th"] = "Quantity";



                    input.Attributes["class"] = "form-control text-center";


                    input.Text = textQ;

                    TableCell td3 = new TableCell();
                    td3.Attributes["data-th"] = "Subtotal";
                    td3.Attributes["class"]   = "text-center";

                    TableCell td4 = new TableCell();
                    td4.Attributes["class"] = "actions";



                    LinkButton delete = new LinkButton();
                    delete.CssClass = "btn btn-danger btn-sm";
                    delete.ID       = shID.ToString() + "=sh";
                    delete.Click   += delegate(object sender, EventArgs e) { deleteBtn_Click(sender, e, shID); };

                    LinkButton refresh = new LinkButton();
                    refresh.CssClass = "btn btn-danger btn-sm";
                    refresh.ID       = shID.ToString() + "=sh1";
                    refresh.Click   += delegate(object sender, EventArgs e) { refreshBtn_Click(sender, e, input, td3, td); };

                    HtmlGenericControl i1 = new HtmlGenericControl("i");
                    i1.Attributes["class"] = "fa fa-refresh";

                    HtmlGenericControl i2 = new HtmlGenericControl("i");
                    i2.Attributes["class"]   = "fa fa-trash-o";
                    th.Attributes["data-th"] = "Product";


                    colsm2.Controls.Add(img);

                    colsm10.Controls.Add(h4);
                    colsm10.Controls.Add(p);
                    td2.Controls.Add(input);

                    delete.Controls.Add(i2);
                    refresh.Controls.Add(i1);
                    td4.Controls.Add(refresh);
                    td4.Controls.Add(delete);
                    row.Controls.Add(colsm2);
                    row.Controls.Add(colsm10);
                    tr.Controls.Add(th);
                    tr.Controls.Add(td);
                    tr.Controls.Add(td2);
                    tr.Controls.Add(td3);
                    tr.Controls.Add(td4);
                    tr.ID = shID.ToString();
                    th.Controls.Add(row);
                    table_body.Controls.Add(tr);
                }
            }
        }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            functions functions = new functions();

            functions.call_tvs(tv_box);
        }
示例#10
0
        protected void search_btn_Click(object sender, EventArgs e)
        {
            functions function = new functions();

            function.search_product(products_box, search_box);
        }