Пример #1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            EmailSender mail = new EmailSender();

            String subject = "SRS Notification Has Run: " + System.DateTime.Now;
            String body = "SRS Has executed successfully.";
            String notifyEmails = "[email protected],[email protected],[email protected]";

            mail.AddEmailAddresses(notifyEmails);
            mail.SendEmail(subject, body);
        }
Пример #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="c"></param>
        private void sendMessage(string source, string project)
        {
            string body = "";
            body = "-----------------------------------------" + (char)10 +
            body + "Source Form: " +  source + (char)10 +
            body + "Project: " +  project + (char)10 +
            body + "-----------------------------------------" + (char)10 +
            body + "Contact Email: " + this.m_contact.EmailAddress + (char)10 +
            body + "First Name: " + this.m_contact.FirstName + (char)10 +
            body + "Last Name: " + this.m_contact.LastName + (char)10 +
            body + "Company: " + this.m_contact.Company + (char)10 +
            body + "Address: " + this.m_contact.Address  + (char)10 +
            body + "Address: " + this.m_contact.Address2 + (char)10 +
            body + "City: " + this.m_contact.City + (char)10 +
            body + "State: " + this.m_contact.State + (char)10 +
            body + "Zip: " + this.m_contact.Zip + (char)10 +
            body + "Country: " + this.m_contact.CountryCode + (char)10 +
            body + "Contact Phone: " + this.m_contact.PhoneNumber  + (char)10 +
            body + "Where Heard: " + this.m_contact.WhereDidYouHear + (char)10 +
            body + "-------------------------------------" + (char)10 +
            body + this.m_contact.Comment3
            ;

            EmailSender mail = new EmailSender();

            String subject = "Product Order Form Reply";
            String notifyEmails = "*****@*****.**";

            mail.AddEmailAddresses(notifyEmails);
            mail.SendEmail(subject, body);
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ArrayList products = new ArrayList();
            int otcSiteMemberId = Convert.ToInt32(Request.Form["user1"]);
            int otcSalesOrderId = Convert.ToInt32(Request.Form["user2"]);
            int result = 0;
            string authCode = "111111";
            string responseMessage = "Denied";
            string avsData = "YYY";
            string pnrRef = "VPCE3F1D15B1";
            //string cardNumber       = Request.Form["CARDNUM"];

            OTCVerisignTransaction tran = new OTCVerisignTransaction();
            OTCSalesOrder order = new OTCSalesOrder(otcSalesOrderId);

            tran.AuthCode = authCode.ToString();
            tran.OTCSalesOrderId = otcSalesOrderId;
            tran.OTCSiteMemberId = otcSiteMemberId;
            tran.AVSData = avsData;
            tran.Cost = order.TotalCost;
            tran.PNRRef = pnrRef;
            tran.ResponseMessage = responseMessage;
            tran.Result = result;
            tran.Add();

            if (responseMessage.ToLower() == "approved")
            {
                string mailBody = OTCSalesOrder.GetEmailProductString(order.OTCSalesOrderId);

                EmailSender mail = new EmailSender();

                String subject = "Order Confirmation - Interceuticals Order " + order.OTCSalesOrderId;
                String notifyEmails = "*****@*****.**";

                mail.AddEmailAddresses(notifyEmails);
                String error = mail.SendEmail(subject, mailBody);

                if (error == "")
                    Response.Write("Successfully sent email.<br>");
                else
                    Response.Write("Error in sending email.  " + error);

                OTC.Web.Promotion.OTCPromotion pr = new OTC.Web.Promotion.OTCPromotion(order.OTCPromotionId);
                pr.AddPromotionUsage(order.OTCSiteMemberId, order.OTCSalesOrderId);

                try
                {
                    //HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create("https://loc1.hitsprocessor.com/confirmation.asp?acct=interceut1&type=60682&s=1&uniqueId=" + order.OTCSalesOrderId + "&orderAmount=" + order.OrderCost);
                    //HttpWebResponse webresp = (HttpWebResponse)webreq.GetResponse();
                    //Response.Write("hit processesor o.k. <br>");
                    HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create("http://*****:*****@cox.net";

                    mail.AddEmailAddresses(notifyEmails);
                    mail.SendEmail(subject, mailBody);

                }
            }
            else
                setAbandoned(tran.OTCSiteMemberId);
        }
Пример #4
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            int orderId = Convert.ToInt32(Request.QueryString["OID"]);
            this.m_order = new OTCSalesOrder(orderId);
            string sql = "SELECT * FROM OTCSalesOrderDetail WHERE OTCSalesOrderId = " + this.m_order.OTCSalesOrderId;
            OTCDatabase db = new OTCDatabase();
            db.Open();
            DataTable dt = db.GetDataset(sql).Tables[0];
            db.ReleaseConnection();
            foreach(DataRow dr in dt.Rows){
                int productId = Convert.ToInt32(dr["OTCProductId"]);
                OTCProduct p = new OTCProduct(productId);
                if(p.CategoryId != 21)
                    Response.End();
                m_productPrice = p.Price;
            }

            EmailSender mail = new EmailSender();

            String subject = "Order Confirmtion - Interceuticals Order " + this.m_order.OTCSalesOrderId;
            String body = "Marketing Information Captured";
            String notifyEmails = "*****@*****.**";

            mail.AddEmailAddresses(notifyEmails);
            //mail.SendEmail(subject, body);
        }
Пример #5
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                this.m_page = new ITCPage();
                OTCShoppingCart cart = new OTCShoppingCart(Session.SessionID);
                Session["wantsMembership"] = Convert.ToBoolean(Request.QueryString["wantsMembership"]);
                int productId = getCorrectProductId(Convert.ToInt32(Request.QueryString["PID"]));
                bool addedItems = false;
                string f = Request.Form.ToString();
                cart = new OTCShoppingCart(this.m_page.ShoppingCartId);
                //cart.RemoveAllItems(this.m_page.ShoppingCartId);
                OTCShoppingCartItem item = new OTCShoppingCartItem();
                OTCProduct product = new OTCProduct(Convert.ToInt32(productId));
                item.ProductID = Convert.ToInt32(productId);
                item.ProductPrice = product.Price;
                item.ItemCount = 1;
                cart.AddCartItem(item);
                string key = "";

                string host = Request.ServerVariables["HTTP_HOST"];

                if (host.IndexOf("localhost") > -1 || host == "cjeycjey.homedns.org:9001" || host == "68.14.68.91:40401")
                    Response.Redirect("/interceuticals/order/precheckout.aspx?" + Request.QueryString.ToString() + "&PID2=" + productId + "&SCID=" + this.m_page.ShoppingCartId + "&site=" + Session["site"] + "&" + (key.Length > 0 ? "?PKY=" + key : ""));
                else if (host == "interceuticals.serveronline.net")
                    Response.Redirect("http://interceuticals.serveronline.net/interceuticals/order/precheckOut.aspx?" + Request.QueryString.ToString() + "&PID2=" + productId + "&SCID=" + this.m_page.ShoppingCartId + "&site=" + Session["site"] + "&" + (key.Length > 0 ? "?PKY=" + key : ""));
                else
                    Response.Redirect("https://www.interceuticals.com/interceuticals/order/precheckout.aspx?" + Request.QueryString.ToString() + "&PID2=" + productId + "&SCID=" + this.m_page.ShoppingCartId + "&site=" + Session["site"] + "&" + (key.Length > 0 ? "?PKY=" + key : ""));
            }
            catch(System.Web.HttpUnhandledException ex)
            {
                string mailBody = Request.QueryString.ToString();

                EmailSender mail = new EmailSender();

                String subject = "Site Error : " + Request.QueryString["PID"];
                String notifyEmails = AppLookup.RecipientsAlerts;

                mail.AddEmailAddresses(notifyEmails);
                mail.SendEmail(subject, mailBody + (char)10 + ex.Message);

                Response.Write("There was an error in our process. We apologize for the inconvenience. We have notified the web master and the problem will be addressed shortly.");
            }
        }
Пример #6
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            ArrayList products      = new ArrayList();
            int otcSiteMemberId     = Convert.ToInt32(Request.Form["user1"]);
            int otcSalesOrderId     = Convert.ToInt32(Request.Form["user2"]);
            SiteName                = Request.Form["user3"];
            CrossDomainTracking     = Request.Form["user4"];
            int result			    = Convert.ToInt32(Request.Form["RESULT"]);
            string authCode			= Request.Form["AUTHCODE"];
            string responseMessage	= Request.Form["RESPMSG"];
            string avsData          = Request.Form["AVSDATA"];
            string pnrRef           = Request.Form["PNREF"];
            //string cardNumber       = Request.Form["CARDNUM"];
            OTCVerisignTransaction tran = null;
            OTCSalesOrder order = null;

            try
            {
                Log.Info("Received post from paypal.");
                Log.InfoFormat("MemberID = {0} SalesOrderID = {1} Result = {2} AuthCode = {3} ResponseMessage = {4}", otcSiteMemberId.ToString(), otcSalesOrderId.ToString(), result.ToString(), authCode, responseMessage);
                tran = new OTCVerisignTransaction();
                order = new OTCSalesOrder(otcSalesOrderId);
                //OTCCreditCard card   = new OTCCreditCard(10181);
                //card.CardNumber      = cardNumber;
                ////card.ExpirationMonth = 7.ToString();
                //card.ExpirationYear  = 2007.ToString();
                //card.OTCSiteMemberId = otcSiteMemberId;
                //card.Add();
                //FFTProduct product   = new FFTProduct(productId);
                //UNCOMMENT ALL THIS
                tran.AuthCode = authCode.ToString();
                tran.OTCSalesOrderId = otcSalesOrderId;
                tran.OTCSiteMemberId = otcSiteMemberId;
                tran.AVSData = avsData;
                tran.Cost = order.TotalCost;
                tran.PNRRef = pnrRef;
                tran.ResponseMessage = responseMessage;
                tran.Result = result;
                tran.Add();

                m_order = order;

            }
            catch (Exception error)
            {
                Log.Error("Unable to complete Paypal transaction.", error);
            }

            if (responseMessage.ToLower() == "approved")
            {

                string mailBody = OTCSalesOrder.GetEmailProductString(order.OTCSalesOrderId);

                EmailSender mail = new EmailSender("*****@*****.**", "BetterMAN.BetterWOMAN");

                String subject = "Order Confirmation - Interceuticals Order " + order.OTCSalesOrderId;
                String notifyEmails = order.EmailAddress;

                mail.AddEmailAddresses(order.EmailAddress);
                mail.AddBccEmailAddresses(AppLookup.RecipientsOrders);
                String error = mail.SendEmail(subject, mailBody);

                if (error == "")
                    Response.Write("Successfully sent email.<br>");
                else
                {
                    Response.Write("Error in sending email.  " + error);
                    Log.Error(error);
                }

                OTC.Web.Promotion.OTCPromotion pr = new OTC.Web.Promotion.OTCPromotion(order.OTCPromotionId);
                pr.AddPromotionUsage(order.OTCSiteMemberId, order.OTCSalesOrderId);

                try
                {
                    HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create("https://loc1.hitsprocessor.com/confirmation.asp?acct=interceut1&type=60682&s=1&uniqueId=" + order.OTCSalesOrderId + "&orderAmount=" + order.OrderCost);

                    HttpWebResponse webresp = (HttpWebResponse)webreq.GetResponse();
                    Response.Write("hit processesor o.k. <br>");
                    /*
                    webreq = (HttpWebRequest)WebRequest.Create("http://www.betterwomannow.com/Interceuticals/Common/Marketing/BetterWoman.aspx?OID=" + order.OTCSalesOrderId);
                    webresp = (HttpWebResponse)webreq.GetResponse();
                    webreq = (HttpWebRequest)WebRequest.Create("http://www.bettermannow.com/Interceuticals/Common/Marketing/BetterMan.aspx?OID=" + order.OTCSalesOrderId);
                    webresp = (HttpWebResponse)webreq.GetResponse();
                    Response.Write("mailsent o.k. <br>"); */
                }
                catch (Exception ex)
                {

                    if (mail == null)
                        mail = new EmailSender();

                    subject = "ERROR: Order Confirmation - Interceuticals Order " + order.OTCSalesOrderId;
                    mailBody = ex.Message;
                    notifyEmails = "*****@*****.**";

                    mail.AddEmailAddresses(notifyEmails);
                    mail.SendEmail(subject, mailBody);

                }
            }
            else
                setAbandoned(tran.OTCSiteMemberId);
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            string sql = "";
            this.m_db.Open();

            sql = "EXEC spGetAbandonedCartsAtInterval";
            DataTable dt = this.m_db.GetDataset(sql).Tables[0];
            this.m_db.ReleaseConnection();

            var sb = new StringBuilder();
            foreach (DataRow dr in dt.Select())
            {
                sb.Append("Abandon Cart Entry" + System.Environment.NewLine);
                sb.Append("========================================" + System.Environment.NewLine);
                foreach (DataColumn dc in dt.Columns)
                {
                    string columnData = "";
                    switch (dc.DataType.Name)
                    {
                        case "DateTime":
                            columnData = Convert.ToDateTime(dr[dc.ColumnName]).ToShortDateString() != "1/1/1900"
                                             ? Convert.ToDateTime(dr[dc.ColumnName]).ToShortDateString()
                                             : "NEVER";
                            break;
                        case "String":
                            columnData = dr[dc.ColumnName].ToString();
                            break;
                        default:
                            columnData = dr[dc.ColumnName].ToString();
                            break;
                    }

                    sb.Append(dc.ColumnName + ": " + columnData + System.Environment.NewLine);

                }
                sb.Append("========================================" + System.Environment.NewLine +
                          System.Environment.NewLine);
            }

            var body = sb.ToString();

            if (!String.IsNullOrEmpty(body))
            {
                var emailSender = new EmailSender();
                emailSender.AddEmailAddresses("*****@*****.**");
                emailSender.SendEmail("Abandon Cart Alert", body);
            }
        }