private void Page_Load(object sender, EventArgs e) { // Put user code to initialize the page here if (GiftCardID > 0) { BPGiftCards bp = new BPGiftCards(); DSGiftcards = bp.SelectGiftCardsByID(Convert.ToInt32(GiftCardID)); BEGiftCards.tbl_GiftCardsRow giftcard; giftcard = DSGiftcards.tbl_GiftCards.FindByGiftCardID(GiftCardID); giftcard.GiftCardApproved = true; bp.Update(DSGiftcards); EmailOrder(); } }
private void btnSubmit_Click(object sender, System.EventArgs e) { //make new gift card row BPGiftCards bp = new BPGiftCards(); BEGiftCards.tbl_GiftCardsRow giftCard; BEGiftCards DSGiftCards = new BEGiftCards(); giftCard = DSGiftCards.tbl_GiftCards.Newtbl_GiftCardsRow(); //fill row giftCard.GiftCardRecipientName = txtRecipientName.Value; giftCard.GiftCardRecipientEmail = txtRecipientEmail.Value; giftCard.GiftCardSenderName = txtSenderName.Value; giftCard.GiftCardSenderEmail = txtSenderEmail.Value; giftCard.GiftCardSenderPhone = txtSenderPhone.Value; giftCard.GiftCardMessage = txtMessage.Value; giftCard.GiftCardSubTotal = Convert.ToDouble(txtEnteredAmount.Value); // if (rbPickup.Checked) // { // giftCard.GiftCardDeliveryMethod = Convert.ToInt32(rbPickup.Value); // giftCard.GiftCardShipping = 0; // }else if (rbCourier.Checked) { giftCard.GiftCardDeliveryMethod = Convert.ToInt32(rbCourier.Value); giftCard.GiftCardShipping = 5; }else if (rbRegularMail.Checked) { giftCard.GiftCardDeliveryMethod = Convert.ToInt32(rbRegularMail.Value); giftCard.GiftCardShipping = 0; } giftCard.GiftCardDeliveryName = txtDeliveryName.Value; giftCard.GiftCardDeliveryAddress = txtDeliveryAddress.Value; giftCard.GiftCardDeliveryCity = txtDeliveryCity.Value; giftCard.GiftCardDeliveryPostalCode = txtDeliveryPostalCode.Value; giftCard.GiftCardComments = txtComments.Value; giftCard.GiftCardGST = 0; giftCard.GiftCardTotal = giftCard.GiftCardSubTotal + giftCard.GiftCardShipping + giftCard.GiftCardGST; giftCard.GiftCardDateCreated = DateTime.Now; giftCard.GiftCardApproved = false; DSGiftCards.tbl_GiftCards.Addtbl_GiftCardsRow(giftCard); bp.Update(DSGiftCards); RegisterClientScriptBlock("redirect","<script>this.parent.location.assign('SendToMiraPay.aspx?gc=" + DSGiftCards.tbl_GiftCards[0].GiftCardID + "')</script>"); // this.Parent.Page.Response.Redirect("SendToMiraPay.aspx?gc="+DSGiftCards.tbl_GiftCards[0].GiftCardID); }