protected void btnSubmit_Click(object sender, EventArgs e) { // Set current user prefs. UserShoppingCart cart = (UserShoppingCart)Session["UserShoppingCartInfo"]; cart.dateOfPickUp = myCalendar.SelectedDate; cart.desiredCar = txtCarMake.Text; cart.desiredCarColor = txtCarColor.Text; cart.downPayment = float.Parse(txtDownPayment.Text); cart.isLeasing = chkIsLeasing.Checked; lblUserInfo.Text = cart.ToString(); Session["UserShoppingCartInfo"] = cart; }
protected void submitButton_Click(object sender, EventArgs e) { // Установить предпочтения текущего пользователя UserShoppingCart cart = Session["UserShoppingCartInfo"] as UserShoppingCart; if (cart == null) { return; } cart.DateOfPickUp = calendar.SelectedDate; cart.DesiredCar = whichMakeTextBox.Text; cart.DesiredCarColor = whichColorTextBox.Text; cart.DownPayment = float.Parse(downPaymentTextBox.Text); cart.IsLeasing = leaseCheckBox.Checked; userInfoLabel.Text = cart.ToString(); Session["UserShoppingCartInfo"] = cart; }
protected void btnSubmit_Click(object sender, EventArgs e) { // Set current user prefs. UserShoppingCart u = (UserShoppingCart)Session["UserShoppingCartInfo"]; u.dateOfPickUp = myCalendar.SelectedDate; u.desiredCar = txtCarMake.Text; u.desiredCarColor = txtCarColor.Text; u.downPayment = float.Parse(txtDownPayment.Text); u.isLeasing = chkIsLeasing.Checked; lblUserInfo.Text = u.ToString(); Session["UserShoppingCartInfo"] = u; lblUserID.Text = string.Format("Here is your ID: {0}", Session.SessionID); }