using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class klient_ostukorv : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DataTable korv = Session["ostukorv"] as DataTable; gwKorv.DataSource = korv; gwKorv.DataBind(); } } protected void gwKorv_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "lisa") { DataTable korv = Session["ostukorv"] as DataTable; DataRow rida = korv.Rows.Find(e.CommandArgument); rida["Kogus"] = Convert.ToInt32(rida["Kogus"]) + 1; Session["ostukorv"] = korv; gwKorv.DataSource = korv; gwKorv.DataBind(); } //Lisa nupp eemaldamise jaoks //Lisage ostukorvi lehele toodete pildid } protected void gwKorv_SelectedIndexChanged(object sender, EventArgs e) { } public string kysiNimetus(int id) { //return "Inimene nr " + id; Toode asi = new ToodeteHaldus().KysiToode(id); return asi.KysiNimetus() + " " + asi.KysiKirjeldus(); } protected void salvestusnupp_Click(object sender, EventArgs e) { ToodeteHaldus t = new ToodeteHaldus(); proovikast.Text = t.LeiaVanaToode(22).ToString(); } }