protected void CreatePayment_Click(object sender, EventArgs e) { // Create Payment OnlineBillPay.Models.Payment newPayment = new OnlineBillPay.Models.Payment(); newPayment.PaymentId = System.Guid.NewGuid().ToString().ToUpper(); newPayment.UserPayeeId = hdnExistingUserPayeeId.Value; newPayment.FundingSourceId = ddlFundingSource.SelectedValue; newPayment.UserId = User.Identity.GetUserId(); newPayment.Amount = float.Parse(txtPaymentAmount.Text); newPayment.DateCreated = DateTime.Now; newPayment.Currency = txtCurrency.Text; newPayment.Status = "Pending"; // Store into DB PaymentDb.InsertPayment(newPayment); UserPayee payee = (UserPayee)Session["PaymentInProgress_payee"]; // Set Payment success notification message Session["Payment_confirmation_message"] = "Your payment to " + payee.Nickname + " for " + newPayment.Amount + "(" + newPayment.Currency + ") is " + newPayment.Status + ". Thank you!"; Session["Payment_confirmation_message_play_count"] = 0; // Dump the UserPayee in Session Session["PaymentInProgress_payee"] = null; // Redirect to Account Home Response.Redirect("/Account/Default"); }
protected void SubmitMassPayee_Click(object sender, EventArgs e) { Debug.WriteLine("REPEATER HAS: " + PayeeList.Items.Count); int i = 0; //for (int i = 0; i < PayeeList.Items.Count; i++) foreach (RepeaterItem item in PayeeList.Items) { // Amount TextBox txtAmount = (TextBox)item.FindControl("txtAmount"); TextBox txtCurrency = (TextBox)item.FindControl("txtCurrency"); DropDownList ddlFundingSource = (DropDownList)item.FindControl("ddlFundingSource"); HiddenField hdnField = (HiddenField)item.FindControl("hdnField"); Debug.WriteLine("AMOUNTS HAS: " + txtAmount.Text); // Has Valye from Form Debug.WriteLine("Funding IS: " + ddlFundingSource.SelectedValue); // Has Valye from Form Debug.WriteLine("UserPayee IS: " + hdnField.Value); // Has Valye from Form // todo - Insert to DB // Create Payment OnlineBillPay.Models.Payment newPayment = new OnlineBillPay.Models.Payment(); newPayment.PaymentId = System.Guid.NewGuid().ToString().ToUpper(); newPayment.UserPayeeId = hdnField.Value; newPayment.FundingSourceId = ddlFundingSource.SelectedValue; newPayment.UserId = User.Identity.GetUserId(); newPayment.Amount = float.Parse(txtAmount.Text); newPayment.DateCreated = DateTime.Now; newPayment.Currency = txtCurrency.Text; newPayment.Status = "Pending"; // Store into DB PaymentDb.InsertPayment(newPayment); i++; } // Set Payment success notification message Session["Payment_confirmation_message"] = "Your " + i + " payments were posted. Thank you!"; Session["Payment_confirmation_message_play_count"] = 0; // Dump the UserPayee in Session Session["PaymentInProgress_payee"] = null; // Redirect to Account Home Response.Redirect("/Account/Default"); }