private void EmailOrder()
		{
			BPGiftCards bp = new BPGiftCards();
			DSGiftcards = bp.SelectGiftCardsByID(Convert.ToInt32(GiftCardID));
			BEGiftCards.tbl_GiftCardsRow giftcard;
			giftcard = DSGiftcards.tbl_GiftCards.FindByGiftCardID(GiftCardID);

			BESetup setupInfo = new BESetup();
			BPSetup bpSetup = new BPSetup();
			setupInfo = bpSetup.SelectAll();

			string email = "";
			if (!giftcard.IsGiftCardSenderEmailNull())
			{
				//email = "*****@*****.**";
				email = giftcard.GiftCardSenderEmail;
			}
			
			if (email == null || email == "")
			{
				email = setupInfo.tbl_Setup[0].SetupEmailAddress1 + "; " + setupInfo.tbl_Setup[0].SetupEmailAddress2;
			}
			else
			{
				if (!setupInfo.tbl_Setup[0].IsSetupEmailAddress1Null())
				{
					email += "; " + setupInfo.tbl_Setup[0].SetupEmailAddress1;
				}

				if (!setupInfo.tbl_Setup[0].IsSetupEmailAddress2Null())
				{
					email += "; " + setupInfo.tbl_Setup[0].SetupEmailAddress2;
				}
			}

			StringBuilder body = GetShippingInfo(giftcard);
			StringBuilder body2 = DisplayCart (giftcard);
			StringBuilder body3 = CalculateTotals (giftcard);

			MailMessage mm = new MailMessage();

			mm.To = email;
			mm.From = setupInfo.tbl_Setup[0].SetupEmailAddress1;
			mm.Subject = string.Format ("Carriel Receipt. Gift Card Receipt #{0}", GiftCardID);
			mm.Body = string.Format ("Gift Card Receipt #{0} <br>", GiftCardID) + body.ToString() + body2.ToString() + body3.ToString();
			mm.BodyFormat = MailFormat.Html;
			SmtpMail.SmtpServer = setupInfo.tbl_Setup[0].SetupEmailServer;
			SmtpMail.Send (mm);
		}
		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();
			}
		}
Ejemplo n.º 3
0
		private void Page_Load(object sender, System.EventArgs e)
		{
			BEGiftCards.tbl_GiftCardsRow giftcard;
			BPGiftCards bp = new BPGiftCards();
			giftcard = bp.SelectGiftCardsByID(Convert.ToInt32(Request.QueryString["gc"])).tbl_GiftCards[0];
		

			string Password = "******";
			string tempMKEY = giftcard.GiftCardID.ToString() + giftcard.GiftCardTotal.ToString("0.00") + Password;
			//string tempMKEY = "110100development";
			string strMKEY = MDString(tempMKEY);

			MTID.Value = giftcard.GiftCardID.ToString();
			MKEY.Value = strMKEY;
			EMail.Value = giftcard.GiftCardSenderEmail;
			Amount1.Value = giftcard.GiftCardTotal.ToString("0.00");
			RegisterStartupScript("submit","<script>document.purchase.submit();</script>");
		}
Ejemplo n.º 4
0
		private void GetGiftCardInfo()
		{
			BPGiftCards bpCat = new BPGiftCards();
			BEGiftCards ds = bpCat.SelectGiftCardsByID(GiftCardID);
			BEGiftCards.tbl_GiftCardsRow GiftCard = ds.tbl_GiftCards.FindByGiftCardID(GiftCardID);
	
			lblTitle.Text = "View GiftCard - " + GiftCard.GiftCardID;
	
			lblGiftCardID.Text = GiftCard.GiftCardID.ToString();
			lblGiftCardDateCreated.Text = GiftCard.GiftCardDateCreated.ToString();

			if (GiftCard.GiftCardApproved == true)
			{
				imgApproved.Visible = true;
				imgNotApproved.Visible = false;
			}
			else
			{
				imgApproved.Visible = false;
				imgNotApproved.Visible = true;
			}

			lblGiftCardRecipientName.Text = GiftCard.GiftCardRecipientName;
			if (!GiftCard.IsGiftCardRecipientEmailNull())
			{
				lblGiftCardRecipientEmail.Text = GiftCard.GiftCardRecipientEmail;
			}
			lblGiftCardSenderName.Text = GiftCard.GiftCardSenderName;
			if (!GiftCard.IsGiftCardSenderEmailNull())
			{
				lblGiftCardSenderEmail.Text = GiftCard.GiftCardSenderEmail;
			}
			if (!GiftCard.IsGiftCardSenderPhoneNull())
			{
				lblGiftCardSenderPhone.Text = GiftCard.GiftCardSenderPhone;
			}
			if (!GiftCard.IsGiftCardMessageNull())
			{
				lblGiftCardMessage.Text = GiftCard.GiftCardMessage;
			}
			lblGiftCardTotal.Text = GiftCard.GiftCardTotal.ToString(MONEY_FORMAT);

			string GiftCardDeliveryMethod = "";
			if (GiftCard.GiftCardDeliveryMethod == 0)
			{
				GiftCardDeliveryMethod = "Pick Up";
			}
			else if (GiftCard.GiftCardDeliveryMethod == 1)
			{
				GiftCardDeliveryMethod = "Courier ($5)";
			}
			else if (GiftCard.GiftCardDeliveryMethod == 2)
			{
				GiftCardDeliveryMethod = "Regular Mail ($0)";
			}

			lblGiftCardDeliveryMethod.Text = GiftCardDeliveryMethod;
			lblGiftCardDeliveryName.Text = GiftCard.GiftCardDeliveryName;
			lblGiftCardDeliveryAddress.Text = GiftCard.GiftCardDeliveryAddress;
			lblGiftCardDeliveryCity.Text = GiftCard.GiftCardDeliveryCity;
			lblGiftCardDeliveryPostalCode.Text = GiftCard.GiftCardDeliveryPostalCode;
			lblGiftCardComments.Text = GiftCard.GiftCardComments;
		}