protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { GridView1.PageIndex = e.NewSelectedIndex; ODT = OAdapter.Sleect_BY_UNAME_Status(DropDownList1.SelectedItem.Text, drpstatus.SelectedIndex); GridView1.DataSource = ODT; GridView1.DataBind(); }
protected void Button3_Click(object sender, EventArgs e) { if (lblqnt.Text == "0") { lbleror.Text = "Qnt Not Enough"; } else { ODT = OAdapter.Sleect_BY_UNAME_INAME(Session["uname"].ToString(), lblname.Text); if (ODT.Rows.Count == 1) { //int qntt = Convert.ToInt32(ODT.Rows[0]["Qnt"].ToString()) + 1; //int pricee = Convert.ToInt32(ODT.Rows[0]["tprice"].ToString()) + Convert.ToInt32(lblprice.Text); //Adapter.Update(Convert.ToInt32(ODT.Rows[0]["oid"].ToString()), lblname.Text, qntt, Convert.ToDouble(ODT.Rows[0]["price"].ToString()), pricee, 0, System.DateTime.Now); OAdapter.ORDER_UPDATE_CART(Convert.ToInt32(ODT.Rows[0]["oid"].ToString()), 1, Convert.ToDouble(lblprice.Text)); //OAdapter.Insert(Session["uname"].ToString(), lblname.Text, qntt.ToString(), lblprice.Text, pricee.ToString(), "0", Image3.ImageUrl.ToString()); Response.Redirect("MyCart.aspx"); } else { OAdapter.Insert(Session["uname"].ToString(), lblname.Text, "1", lblprice.Text, lblprice.Text, "0", Image3.ImageUrl.ToString()); Response.Redirect("MyCart.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { ODT = OAdapter.Sleect_BY_UNAME_Status(Session["uname"].ToString(), 0); GridView1.DataSource = ODT; GridView1.DataBind(); } }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { int oidd = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value); OAdapter.Delete(oidd); ODT = OAdapter.Sleect_BY_UNAME_Status(Session["uname"].ToString(), 0); GridView1.DataSource = ODT; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { ODT = OAdapter.SELECT_DISTINCT(); DropDownList1.DataSource = ODT; DropDownList1.DataTextField = "uname"; DropDownList1.DataValueField = "oid"; DropDownList1.DataBind(); } }
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { int oidd = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value); TextBox txtqq = GridView1.Rows[e.RowIndex].Cells[3].FindControl("txtq") as TextBox; string pricee = GridView1.Rows[e.RowIndex].Cells[2].Text; double tpricee = Convert.ToInt32(pricee) * Convert.ToInt32(txtqq.Text); OAdapter.ORDER_UPDATE_CART_ALREADY_ADD(oidd, Convert.ToInt32(txtqq.Text), tpricee); ODT = OAdapter.Sleect_BY_UNAME_Status(Session["uname"].ToString(), 0); GridView1.DataSource = ODT; GridView1.DataBind(); }
protected void btncash_Click(object sender, EventArgs e) { PAdapter.Insert(Session["uname"].ToString(), Convert.ToDouble(lblpayment.Text), DropDownList1.SelectedItem.Text, "", "", "", 0, System.DateTime.Now); ODT = OAdapter.Sleect_BY_UNAME_Status(Session["uname"].ToString(), 0); for (int i = 0; i < ODT.Rows.Count; i++) { IAdapter.ITEM_UPDATE_SELL(ODT.Rows[i]["iname"].ToString(), Convert.ToInt32(ODT.Rows[i]["qnt"].ToString())); } OAdapter.ORDER_UPDATE_STATUS_BY_NAME(Session["uname"].ToString(), 1); Response.Redirect("Thanks.aspx"); }
protected void Button3_Click(object sender, EventArgs e) { ODT = OAdapter.Sleect_BY_UNAME_Status(Session["uname"].ToString(), 0); for (int i = 0; i < ODT.Rows.Count; i++) { IDT = IAdapter.Select_BY_INAME(ODT.Rows[i]["iname"].ToString()); if (Convert.ToInt32(IDT.Rows[0]["Aqnt"].ToString()) < Convert.ToInt32(ODT.Rows[i]["Qnt"].ToString())) { lblmsg.Text = ODT.Rows[i]["iname"].ToString() + " Quantity must be less then buy quantity"; } else { Response.Redirect("Checkout.aspx"); } } }
protected void Button9_Click(object sender, EventArgs e) { ODT = OAdapter.Sleect_BY_UNAME_Status(DropDownList1.SelectedItem.Text, drpstatus.SelectedIndex); GridView1.DataSource = ODT; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { lbl.Text = ""; ODT = OAdapter.Select_AMT(Session["uname"].ToString()); lblpayment.Text = ODT.Rows[0]["tprice"].ToString(); }
protected void Page_Load(object sender, EventArgs e) { ODT = OAdapter.Select_BY_UANME(Session["uname"].ToString()); GridView1.DataSource = ODT; GridView1.DataBind(); }