public string GetSecondaryPaymentName() { for (int i = 0; i < uxPaymentList.Items.Count; i++) { RadioButton radio = (RadioButton)uxPaymentList.Items[i].FindControl("uxRadio"); if (radio.Checked) { string name = uxPaymentList.DataKeys[i].ToString(); if (PaymentOption.IsCustomPayment(name)) { string dropDownValue = GetDropDownValue(i); if (!String.IsNullOrEmpty(dropDownValue)) { return(dropDownValue); } else { return(String.Empty); } } } } return(String.Empty); }
public void RestorePaymentMethod() { PaymentOption paymentOption = StoreContext.CheckoutDetails.PaymentMethod.PaymentOption; if (paymentOption == null) { return; } for (int i = 0; i < uxPaymentList.Items.Count; i++) { HiddenField nameHidden = (HiddenField)uxPaymentList.Items[i].FindControl("uxPaymentNameHidden"); if (nameHidden.Value == paymentOption.Name) { RadioButton radio = (RadioButton)uxPaymentList.Items[i].FindControl("uxRadio"); radio.Checked = true; if (PaymentOption.IsCustomPayment(paymentOption.Name)) { DropDownList drop = (DropDownList)uxPaymentList.Items[i].FindControl("uxDrop"); drop.SelectedValue = StoreContext.CheckoutDetails.PaymentMethod.SecondaryName; } else if (paymentOption.Name == "Purchase Order") { uxPOpanel.Visible = true; uxPONumberText.Text = StoreContext.CheckoutDetails.PaymentMethod.PONumber; } break; } } }
public bool IsAnyPaymentSelected() { string paymentName = GetSelectedPaymentName(); if (String.IsNullOrEmpty(paymentName)) { return(false); } else { if (PaymentOption.IsCustomPayment(paymentName)) { string secondaryName = GetSecondaryPaymentName(); if (String.IsNullOrEmpty(secondaryName)) { return(false); } else { return(true); } } else { return(true); } } }
protected void uxPaymentList_ItemDataBound(object sender, DataListItemEventArgs e) { string paymentName = DataBinder.Eval(e.Item.DataItem, "Name").ToString(); if (PaymentOption.IsCustomPayment(paymentName) && !StoreContext.ShoppingCart.ContainsRecurringProduct()) { DropDownList dropDown = (DropDownList)e.Item.FindControl("uxDrop"); PopulateCustomDropDown(dropDown); } }