public void GetNiche(int _resourceID) { try { ColInfo item = ColController.GetNiche(_resourceID); if (item != null) { HiddenFieldNicheID.Value = _resourceID.ToString(); HiddenFieldPrice.Value = item.Price.ToString(); if (item.Status == "a") { lblNicheNumber.Text = "Niche Number: " + item.NicheNumber.ToString() + " - " + item.SectionName.ToString(); lblNichePrice.Text = "Niche Price: " + item.Price.ToString("C", CultureInfo.CurrentCulture); } else { Response.Redirect(Globals.NavigateURL(), true); } } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
public void SendConfirmationEmail(int _nicheID) { try { ColInfo item = ColController.GetNiche(_nicheID); //load the item // GiftCertificateController controller = new GiftCertificateController(); // GiftCertificateInfo item = controller.GetGiftCert(_itemID); if (item != null) { string _emailFrom = ""; string _emailSubject = ""; string _emailMessage = ""; string _emailNotify = ""; // EmailBCC EmailSubject EmailMessage if (Settings.Contains("EmailFrom")) { _emailFrom = Settings["EmailFrom"].ToString(); } else { _emailFrom = PortalSettings.Email.ToString(); } if (Settings.Contains("EmailNotify")) { _emailNotify = Settings["EmailNotify"].ToString(); } else { _emailNotify = PortalSettings.Email.ToString(); } if (Settings.Contains("EmailSubject")) { _emailSubject = Settings["EmailSubject"].ToString(); } else { _emailSubject = "New Order"; } if (Settings.Contains("EmailMessage")) { _emailMessage = Settings["EmailMessage"].ToString(); } // EmailContent = "<style type='text / css'>"; EmailContent += "body{background: #ffffff;font-family: verdana, arial;font-size: 10px;color: #000000;}"; EmailContent += "h4 {color: #840000; font-family: verdana, arial;font-size: 16px;}"; EmailContent += "</style>"; // BUILD E-MAIL BODY EmailContent += "<p><b>Print this page and mail it with your payment . . . </b></p>"; EmailContent += "<h5>Date of Purchase: " + item.DateOfReservation.ToString() + "</h5>"; EmailContent += "<h2>Holy Trinity Memorial Wall Niche Purchase</h2>"; EmailContent += "<h4>Niche: " + item.NicheNumber.ToString() + " - " + item.SectionName.ToString(); EmailContent += "<br>Niche Price: " + String.Format("{0:c}", item.Price) + "</ h4 >"; EmailContent += "<h5>Purchaser Information:</h5>"; EmailContent += "<blockquote><p>"; EmailContent += item.salutation.ToString() + " " + item.FirstName.ToString() + " " + item.MiddleInitial.ToString() + " " + item.LastName.ToString() + " " + item.Suffix.ToString(); EmailContent += "<br />" + item.Address1.ToString(); if (item.Address2.ToString().Length > 0) { EmailContent += "<br />" + item.Address2.ToString(); } EmailContent += "<br>" + item.City.ToString() + ", " + item.State.ToString() + " " + item.Zip.ToString() + "</p>"; EmailContent += "<p>"; if (item.phone_day.ToString().Length > 0) { EmailContent += "Daytime Phone: " + item.phone_day.ToString() + "<br />"; } if (item.phone_eve.ToString().Length > 0) { EmailContent += "Evening Phone: " + item.phone_eve.ToString() + "<br />"; } if (item.phone_fax.ToString().Length > 0) { EmailContent += "Fax Phone: " + item.phone_fax.ToString() + "<br />"; } if (item.phone_cell.ToString().Length > 0) { EmailContent += "Cell Phone: " + item.phone_cell.ToString() + "<br />"; } EmailContent += "</p></blockquote>"; if (item.Comments.ToString().Length > 0) { EmailContent += "<p>"; EmailContent += "<b>Questions/Comments:</b><br /><br />" + item.Comments.ToString(); EmailContent += "</p>"; } // EmailContent += "<br /> "; EmailContent += "<hr style='background-color: #fff;border - top: 8px dashed #8c8b8b;' width=600>"; EmailContent += "<p>Make your check payable to <b><font color='RED'>Holy Trinity Church</font></b> and mail your payment to:</p>"; EmailContent += "<p>Peterson Realty, Inc.<br>"; EmailContent += "P.O. Box 324<br>West Harwich, MA 02671</p>"; EmailContent += "<p>Page Submitted: " + Globals.NavigateURL() + "</p>"; //EMAIL THE PURCHASER string EmailFrom = ""; if (_emailFrom.Length > 1) { EmailFrom = _emailFrom.ToString(); } else { EmailFrom = PortalSettings.Email.ToString(); } string SMTPUserName = DotNetNuke.Entities.Controllers.HostController.Instance.GetString("SMTPUsername"); string[] arrNoAttachements = new string[] { }; // EMAIL PURCHASER DotNetNuke.Services.Mail.Mail.SendMail(SMTPUserName.ToString(), item.email.ToString(), "", "", _emailFrom.ToString(), DotNetNuke.Services.Mail.MailPriority.Normal, _emailSubject.ToString(), DotNetNuke.Services.Mail.MailFormat.Html, System.Text.Encoding.Default, EmailContent.ToString(), arrNoAttachements, "", "", "", "", true); //// EMAIL THE settingsData.EmailNotify //// ADD NOTE for ADMINS . . . . string AdminEmailContent = "<p><b>Administrators must log in to the site to manage record.</b></p>"; if (_emailNotify.ToString().Length > 1) { string FromPurchaserEmail = item.email.ToString(); string emailAddress = _emailNotify.ToString().Replace(" ", ""); string[] valuePair = emailAddress.Split(new char[] { ';' }); for (int i = 0; i <= valuePair.Length - 1; i++) { DotNetNuke.Services.Mail.Mail.SendMail(SMTPUserName.ToString(), valuePair[i].ToString().Trim(), "", "", FromPurchaserEmail.ToString(), DotNetNuke.Services.Mail.MailPriority.Normal, _emailSubject.ToString(), DotNetNuke.Services.Mail.MailFormat.Html, System.Text.Encoding.Default, EmailContent.ToString() + AdminEmailContent.ToString(), arrNoAttachements, "", "", "", "", true); } } } else { Response.Redirect(Globals.NavigateURL(), true); } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
public void GetNiche(int _resourceID) { try { ColInfo item = ColController.GetNiche(_resourceID); if (item != null) { _DisplaySection = item.NicheSection.ToString(); if (item.isPaid) { Image122.ImageUrl = this.TemplateSourceDirectory + "/images/yes.png"; Image122.ToolTip = "Paid in Full"; Image122.AlternateText = "Paid in Full"; LinkButtonDelete.Visible = false; } else { Image122.ImageUrl = this.TemplateSourceDirectory + "/images/no.png"; Image122.ToolTip = "Monies Owed"; Image122.AlternateText = "Monies Owed"; } HiddenFieldNicheID.Value = item.NicheID.ToString(); HiddenFieldPurchaserID.Value = item.PurchaserID.ToString(); HiddenFieldPrice.Value = item.Price.ToString(); lblNicheNumber.Text = "Niche: " + item.NicheNumber.ToString() + " - " + item.SectionName.ToString(); lblNichePrice.Text = "Price: " + item.Price.ToString("C", CultureInfo.CurrentCulture); _nicheCost = item.Price; //PURCHASER txtFirstName.Text = item.FirstName.ToString(); ddlSuffix.SelectedValue = item.Suffix.ToString(); txtMiddleInitial.Text = item.MiddleInitial.ToString(); ddlPrefix.SelectedValue = item.salutation.ToString(); txtLastName.Text = item.LastName.ToString(); txtAddress1.Text = item.Address1.ToString(); txtAddress2.Text = item.Address2.ToString(); txtCity.Text = item.City.ToString(); ddlState.SelectedValue = item.State.ToString(); txtZipCode.Text = item.Zip.ToString(); txtEmail.Text = item.email.ToString(); txtCellPhone.Text = item.phone_cell.ToString(); txtDayPhone.Text = item.phone_day.ToString(); txtFaxPhone.Text = item.phone_fax.ToString(); txtComments.Text = item.Comments.ToString(); txtNightPhone.Text = item.phone_eve.ToString(); // REMAINS 1 ddlPrefixR1.SelectedValue = item.Remains1Salutation.ToString(); txtFirstNameR1.Text = item.Remains1FirstName.ToString(); txtMiddleInitialR1.Text = item.Remains1MI.ToString(); txtLastNameR1.Text = item.Remains1LastName.ToString(); ddlSuffixR1.SelectedValue = item.Remains1Suffix.ToString(); if (DateTime.TryParse(item.Remains1DOB.ToString(), out temp)) { if (item.Remains1DOB != null) { txtRemains1DOB.Text = DateTime.Parse(item.Remains1DOB.ToString()).ToShortDateString(); } } txtRemains1CityOfBirth.Text = item.Remains1CityOfBirth.ToString(); txtRemains1StateOfBirth.Text = item.Remains1StateOfBirth.ToString(); if (DateTime.TryParse(item.Remains1DOD.ToString(), out temp)) { if (item.Remains1DOD != null) { txtRemains1DOD.Text = DateTime.Parse(item.Remains1DOD.ToString()).ToShortDateString(); } } txtRemains1CityOfDeath.Text = item.Remains1CityOfDeath.ToString(); txtRemains1StateOfDeath.Text = item.Remains1StateOfDeath.ToString(); txtRemains1Obituary.Text = item.Remains1Obituary.ToString(); // REMAINS 2 ddlPrefixR2.SelectedValue = item.Remains2Salutation.ToString(); txtFirstNameR2.Text = item.Remains2FirstName.ToString(); txtMiddleInitialR2.Text = item.Remains2MI.ToString(); txtLastNameR2.Text = item.Remains2LastName.ToString(); ddlSuffixR2.SelectedValue = item.Remains2Suffix.ToString(); if (DateTime.TryParse(item.Remains2DOB.ToString(), out temp)) { if (item.Remains2DOB != null) { txtRemains2DOB.Text = DateTime.Parse(item.Remains2DOB.ToString()).ToShortDateString(); } } txtRemains2CityOfBirth.Text = item.Remains2CityOfBirth.ToString(); txtRemains2StateOfBirth.Text = item.Remains2StateOfBirth.ToString(); if (DateTime.TryParse(item.Remains2DOD.ToString(), out temp)) { if (item.Remains2DOD != null) { txtRemains2DOD.Text = DateTime.Parse(item.Remains2DOD.ToString()).ToShortDateString(); } } txtRemains2CityOfDeath.Text = item.Remains2CityOfDeath.ToString(); txtRemains2StateOfDeath.Text = item.Remains2StateOfDeath.ToString(); txtRemains2Obituary.Text = item.Remains2Obituary.ToString(); txtAmountPaid.Text = item.AmountPaid.ToString("C"); if (DateTime.TryParse(item.DateOfPayment.ToString(), out temp)) { if (item.DateOfPayment != null) { txtDateOfPayment.Text = DateTime.Parse(item.DateOfPayment.ToString()).ToShortDateString(); } } txtDateOfReservation.Text = DateTime.Parse(item.DateOfReservation.ToString()).ToShortDateString(); txtInternalNotes.Text = item.InternalNotes.ToString(); txtAncestorName.Text = item.AncestorName.ToString(); cbxHasAncestor.Checked = item.HasAncestor; cbxHasDonated.Checked = item.HasDonated; cbxParishioner.Checked = item.Parishioner; ddlPrefix1.SelectedValue = item.Salutation1; txtFirstName1.Text = item.FirstName1; txtMiddleInitial1.Text = item.MiddleInitial1; txtLastName1.Text = item.LastName1; ddlSuffix1.SelectedValue = item.Suffix1; } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
public void SendConfirmationEmail(int _nicheID) { try { ColInfo item = ColController.GetNiche(_nicheID); //load the item // GiftCertificateController controller = new GiftCertificateController(); // GiftCertificateInfo item = controller.GetGiftCert(_itemID); if (item != null) { string _emailFrom = ""; string _emailSubject = ""; string _emailMessage = ""; string _emailNotify = ""; string _emailBCC = ""; //EmailBCC // EmailBCC EmailSubject EmailMessage if (Settings.Contains("EmailFrom")) { _emailFrom = Settings["EmailFrom"].ToString(); } else { _emailFrom = PortalSettings.Email.ToString(); } if (Settings.Contains("EmailNotify")) { _emailNotify = Settings["EmailNotify"].ToString(); } else { _emailNotify = PortalSettings.Email.ToString(); } if (Settings.Contains("EmailSubject")) { _emailSubject = Settings["EmailSubject"].ToString(); } else { _emailSubject = "New Order"; } if (Settings.Contains("EmailMessage")) { _emailMessage = Settings["EmailMessage"].ToString(); } if (Settings.Contains("EmailBCC")) { _emailBCC = Settings["EmailBCC"].ToString(); } // EmailContent = "<style type='text/css'>"; EmailContent += "body{background: #ffffff;font-family: verdana, arial;font-size: 10px;color: #000000;}"; EmailContent += "h4 {color: #840000; font-family: verdana, arial;font-size: 16px;}"; EmailContent += "</style>"; // BUILD E-MAIL BODY // EmailContent += "<p><b>Print this and mail it with your payment . . . </b></p>"; EmailContent += "<h5>Order Date: " + item.DateOfReservation.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + "</h5>"; EmailContent += "<h2>Niche Order Confirmation</h2>"; EmailContent += "<h4>Niche Number: " + item.NicheNumber.ToString() + " - " + item.SectionName.ToString(); EmailContent += "<br>Niche Price: " + String.Format("{0:c}", item.Price) + "</h4>"; EmailContent += "<h5>Purchaser Information:</h5>"; EmailContent += "<p>"; // EmailContent += item.salutation.ToString() + " " + item.FirstName.ToString() + " " + item.MiddleInitial.ToString() + " " + item.LastName.ToString() + " " + item.Suffix.ToString(); EmailContent += item.Buyer1.ToString(); if (item.Buyer2.ToString().Length > 0) { EmailContent += "<br />" + item.Buyer2.ToString(); } EmailContent += "<br />" + item.Address1.ToString(); if (item.Address2.ToString().Length > 0) { EmailContent += "<br />" + item.Address2.ToString(); } EmailContent += "<br>" + item.City.ToString() + ", " + item.State.ToString() + " " + item.Zip.ToString() + "</p>"; EmailContent += "<p>"; if (item.phone_day.ToString().Length > 0) { EmailContent += "Daytime Phone: " + item.phone_day.ToString() + "<br />"; } if (item.phone_eve.ToString().Length > 0) { EmailContent += "Evening Phone: " + item.phone_eve.ToString() + "<br />"; } if (item.phone_fax.ToString().Length > 0) { EmailContent += "Fax Phone: " + item.phone_fax.ToString() + "<br />"; } if (item.phone_cell.ToString().Length > 0) { EmailContent += "Cell Phone: " + item.phone_cell.ToString() + "<br />"; } if (item.email.ToString().Length > 0) { EmailContent += "E-Mail: " + item.email.ToString() + "<br />"; } EmailContent += "</p>"; if (item.Comments.ToString().Length > 0) { EmailContent += "<p>"; EmailContent += "<b>Questions/Comments:</b><br /><br />" + item.Comments.ToString(); EmailContent += "</p>"; } EmailContent += "<p>"; EmailContent += "<b>Parishioner:</b> " + ReturnBooleanAsString(item.Parishioner) + "<br />"; EmailContent += "<b>Past Pledge:</b> " + ReturnBooleanAsString(item.HasDonated) + "<br />"; EmailContent += "<b>Has Ancestor:</b> " + ReturnBooleanAsString(item.HasAncestor); if (item.HasAncestor.ToString() == "True") { EmailContent += "<br /><b>Ancestor Name:</b> " + item.AncestorName.ToString(); } EmailContent += "</p>"; // EmailContent += "<br /> "; EmailContent += "<hr style='background-color: #fff;border-top: 4px dashed #8c8b8b;'>"; EmailContent += _emailMessage.ToString(); EmailContent += "<p>Page Submitted: " + Globals.NavigateURL() + "</p>"; //EMAIL THE PURCHASER string EmailFrom = ""; if (_emailFrom.Length > 1) { EmailFrom = _emailFrom.ToString(); } else { EmailFrom = PortalSettings.Email.ToString(); } string SMTPUserName = DotNetNuke.Entities.Controllers.HostController.Instance.GetString("SMTPUsername"); // string[] arrNoAttachements = new string[] { }; List <Attachment> attchmnts = new List <Attachment>(); // EMAIL PURCHASER DotNetNuke.Services.Mail.Mail.SendMail("Holy Trinity Columbarium <" + SMTPUserName.ToString() + ">", "Holy Trinity Columbarium <" + SMTPUserName.ToString() + ">", item.email.ToString(), "", "", EmailFrom.ToString(), DotNetNuke.Services.Mail.MailPriority.Normal, _emailSubject.ToString(), DotNetNuke.Services.Mail.MailFormat.Html, System.Text.Encoding.Default, EmailContent.ToString(), attchmnts, "", "", "", "", true); //// EMAIL THE settingsData.EmailNotify //// ADD NOTE for ADMINS . . . . string AdminEmailContent = "<p><b>Administrators must log in to the site to manage record.</b></p>"; if (_emailNotify.ToString().Length > 1) { string FromPurchaserEmail = item.email.ToString(); string emailAddress = _emailNotify.ToString().Replace(" ", ""); string[] valuePair = emailAddress.Split(new char[] { ';' }); for (int i = 0; i <= valuePair.Length - 1; i++) { DotNetNuke.Services.Mail.Mail.SendMail("Holy Trinity Columbarium <" + SMTPUserName.ToString() + ">", "Holy Trinity Columbarium <" + SMTPUserName.ToString() + ">", valuePair[i].ToString().Trim(), "", _emailBCC.ToString(), FromPurchaserEmail.ToString(), DotNetNuke.Services.Mail.MailPriority.Normal, _emailSubject.ToString(), DotNetNuke.Services.Mail.MailFormat.Html, System.Text.Encoding.Default, EmailContent.ToString() + AdminEmailContent.ToString(), attchmnts, "", "", "", "", true); } } } else { Response.Redirect(Globals.NavigateURL(), true); } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }