protected void btn_purchase_Click(object sender, EventArgs e) { bool cvcIsInt = false; int cvc; cvcIsInt = Int32.TryParse(txt_cvc.Text, out cvc); if (cvcIsInt) { string name = txt_holdername.Text; string cardno = txt_card_no.Text; int month = Int16.Parse(ddlexpmonth.SelectedValue); int year = Int16.Parse(ddlexpyear.SelectedValue); cvc = Int16.Parse(txt_cvc.Text); try { CheckOutProcess.AddCardInfo(userid, name, cardno, month, year, cvc); ClearText(); } catch (Exception exp) { Response.Write(exp.ToString()); } Session["cardno"] = cardno; Response.Redirect("~/OrderSummary.aspx"); } else { txt_cvc.Text = ""; } }
private void CheckExistingCredit(int userid) { List <CreditCard> Cards = CheckOutProcess.GetCreditCard(userid); if (Cards.Count == 0) { btn_checkout_cardn0.Visible = false; } else { RadioButtonListCCard.DataSource = Cards.ToList(); RadioButtonListCCard.DataTextField = "CardNumber"; RadioButtonListCCard.DataValueField = "CardID"; RadioButtonListCCard.DataBind(); btn_checkout.Visible = false; } }