Button on click save objects to database

Morolord

New Member
So I have an event that is when you click a button I want to send an \[code\]int\[/code\], \[code\]string\[/code\], \[code\]datetime\[/code\] and \[code\]bool\[/code\] to my database.Right now it will get the input from my webform for the "Company" and the "DayNumber". I want to get the value of my \[code\]CheckBox01\[/code\] as the boolean for WeatherRain and the input from the Date. You should be able to choose the date not just take it from "now".I don't know what would be the best way to get this done, I do have around 100 different fields to get user input from.\[code\]protected void btnTryck_Click(object sender, EventArgs e){ Dagbok bok = DagbokFactory.CreateNew(); bok.Company = String.Format(TextBox1.Text); bok.DayNumber = Convert.ToInt32(TextBox19.Text); bok.WeatherRain = false; bok.Date = DateTime.Now;}\[/code\]
 
Back
Top