protected void Button1_Click(object sender, EventArgs e) { string user = TextBox1.Text; int foodID = Int32.Parse(DropDownList1.SelectedValue); string foodname = DropDownList1.SelectedItem.ToString(); string size = RadioButtonList1.SelectedItem.ToString(); string chilli = (CheckBox1.Checked ? "Y" : "N"); string salt = (CheckBox2.Checked ? "Y" : "N"); string pepper = (CheckBox3.Checked ? "Y" : "N"); try { BusinessLogic.AddOrder(user, foodID, foodname, size, chilli, salt, pepper); Response.Redirect("Default2.aspx?username=" + user); } catch (Exception exp) { } }
public void AddOrder(string user, int foodID, string foodname, string size, string chilli, string salt, string pepper) { BusinessLogic.AddOrder(user, foodID, foodname, size, chilli, salt, pepper); }