protected void GridViewCustomers_SelectedIndexChanged(object sender, EventArgs e) { int Empl_id = Int32.Parse(DropDownList1.SelectedValue.ToString()); int Cust_id = Int32.Parse(GridViewCustomers.SelectedValue.ToString()); string EAN = Server.UrlDecode(Request.QueryString["EAN"]); int count = Int32.Parse(TextBoxCount.Text); OkPneuTire tire = new OkPneuTire(); OkPneuTireTable okTable = new OkPneuTireTable(); tire = okTable.Select(EAN); decimal price = tire.ProdejniCena; OrderTable tb = new OrderTable(); int result = tb.InsertNewOrder(Cust_id, Empl_id, EAN, count, price); if(result > 0) Response.Redirect("~/Customers/Orders"); else Page.ClientScript.RegisterStartupScript(GetType(), "msgbox", "alert('Něco je špatně');", true); }