private void SendEmail(string paymentMode)
        {
            TextWriter     tw    = new StringWriter();
            HtmlTextWriter hw    = new HtmlTextWriter(tw);
            IOrder         order = ApiObjectFactory.GetObject <IOrder>();
            var            dt    = order.GetOrder((Guid)SessionM["OrderId"]);

            InvoiceDetail1.RenderControl(hw);
            var customer = (ICustomer)SessionM["Customer"];

            Email = customer.CusInfo.Email;
            Dictionary <string, string> replaceString = new Dictionary <string, string>();

            replaceString["<%=CustomerName%>"] = Helper.ToProperCase(customer.CusInfo.Name);
            replaceString["<%=CustomerId%>"]   = customer.CusInfo.CustomerID;
            replaceString["<%=OrderDetail%>"]  = tw.ToString();
            replaceString["<%=OrderNumber%>"]  = dt.Rows[0]["OrderNumber"].ToString();

            string orderUpdateLink = Request.Url.AbsoluteUri;

            orderUpdateLink = orderUpdateLink.Replace(Request.FilePath, "/Payment/UpdatePaymentReference.aspx");

            orderUpdateLink = "<a href=" + orderUpdateLink + "?rid=" + SessionM["OrderId"].ToString() + " >" + orderUpdateLink + "</a>";


            replaceString["<%=OrderUpdateLink%>"] = orderUpdateLink;

            SendEmail(GetEmailHtmlFile(paymentMode), "Order Detail", customer.CusInfo.Email, replaceString);
        }
Exemplo n.º 2
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            TextWriter     tw    = new StringWriter();
            HtmlTextWriter hw    = new HtmlTextWriter(tw);
            IOrder         order = ApiObjectFactory.GetObject <IOrder>();
            var            dt    = order.GetOrder((Guid)SessionM["OrderId"]);

            InvoiceDetail1.RenderControl(hw);

            var customer = (ICustomer)SessionM["Customer"];

            OrderNumber = dt.Rows[0]["OrderNumber"].ToString();

            Dictionary <string, string> replaceString = new Dictionary <string, string>();

            replaceString["<%=CustomerName%>"] = Helper.ToProperCase(customer.CusInfo.Name);
            replaceString["<%=CustomerId%>"]   = customer.CusInfo.CustomerID;
            replaceString["<%=OrderDetail%>"]  = tw.ToString();
            replaceString["<%=OrderNumber%>"]  = dt.Rows[0]["OrderNumber"].ToString();
            SendEmail("Order.htm", "Order Detail", customer.CusInfo.Email, replaceString);
        }