protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { foreach (ListItem li in allTeeTimes//.Where(tt => tt.TimeOfDay ) .Select(tt => new ListItem(tt.TimeOfDay.ToString(), tt.ToShortTimeString()))) DropDownList2.Items.Add(li); } if (IsPostBack) { customer newCustomer = new customer(); newCustomer.firstName = Request.Form["first_name"]; newCustomer.lastName = Request.Form["last_name"]; newCustomer.email = Request.Form["user_email"]; if (!allCustomers.Contains(newCustomer)) allCustomers.Add(newCustomer); DateTime date = Convert.ToDateTime(Request.Form["date"]); DateTime time = Convert.ToDateTime(DropDownList2.SelectedItem.Value); teetime booking = new teetime(); booking.booker = newCustomer; booking.time = new DateTime(date.Year, date.Month, date.Day, time.Hour, time.Minute, time.Second); booking.numGuests = int.Parse(NoGuests.SelectedItem.Value); WebApplication1.File.SaveBooking(booking); } }
partial void Deletecustomer(customer instance);
partial void Updatecustomer(customer instance);
partial void Insertcustomer(customer instance);