I'm making a C# airlines reservation project, taking the user details via form1, say I have a class PassengerDetails with class variables. Now, on click of the button, I need to assign all those TextBox values to the class variables
private void btnSubmit_Click(object sender, EventArgs e)
{
string fn = txtFname.Text;
string ln = txtLname.Text;
string add = txtAddress.Text;
int age = int.Parse(txtAge.Text);
submit(fn, ln, add, age);
}
I need to pass these to the function. How should I declare it?
fnandlndon't say much, andaddis plain misleading. What's wrong withfirstname,lastnameandaddress? Intellisense will type it for you after the first time.