/ Forside / Teknologi / Udvikling / ASP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
Print til fakturaside
Fra : Peter Nicolaj


Dato : 19-05-10 16:00

Sidder med et dokument til en webshop som indeholder koden til
gennemførelse af betaling og faktura.

Der mangler dog et printikon, så bruger kan udskrive fakturaen.

Jeg har prøvet at sætte kode ind til en printknap i både
javascript og html, men får fejl når jeg tester efterfølgende.

Er der nogen som ud fra koden nedenunder, har en idé?

Beklager jeg bare smider en lang kode ind, men har ikke rigtig
nogen idé om hvor jeg skal sætte et evt. printscript ind henne.


namespace DotNetNuke.Modules.Store.Cart {
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Globalization;
using DotNetNuke.Modules.Store.Customer;
using DotNetNuke.Modules.Store.Providers.Address;
using DotNetNuke.Services.Localization;
using DotNetNuke.Entities.Users;
using DotNetNuke.Entities.Tabs;
using DotNetNuke.Common;
using Store.Admin;
using Store.Customer;
using System.Text;
using System.Net.Mail;
using System.Net;
using System.Data.Odbc;

public partial class xxx : PaymentControlBase {
private static string CookieName =
"DotNetNuke_Store_Portal_";
private string email, kommentar;
private string orderNumber;

protected void Page_Load(object sender, EventArgs e) {
FinalMessage.Visible = false;
PaymentOptions.Visible = true;
ScriptManager.GetCurrent(this.Page).EnablePageMethods
= true;

if (Request.QueryString["ordrenummer"] != null &&
Request.QueryString["ordrenummer"] != "")
{
orderNumber = Request.QueryString["ordrenummer"];

OrderInfo i =
base.CheckoutControl.GetFinalizedOrderInfo();

string order = orderConf();

lblOrderInfo.Text = order;

base.CheckoutControl.Hide();
this.FinalMessage.Visible = true;
this.PaymentOptions.Visible = false;
this.panelCardPayment.Visible = false;
CurrentCart.ClearItems(base.PortalId);
this.SetOrderIdCookie(-1);
}
}

protected void Button1_Click(object sender, EventArgs e)
{
this.confirmOrder();
}

[WebMethod]
public void confirmPayment()
{
OrderInfo i =
base.CheckoutControl.GetFinalizedOrderInfo();

string order = orderConf();

lblOrderInfo.Text = order;

base.CheckoutControl.Hide();
this.FinalMessage.Visible = true;
this.PaymentOptions.Visible = false;
this.panelCardPayment.Visible = false;
CurrentCart.ClearItems(base.PortalId);
this.SetOrderIdCookie(-1);

}

private string ordrenummer(){
Random rand = new Random();
string bogstaver = "ABCDEFGHIJKLMNOPQRSTUVXYZW";
int rand1 = rand.Next(0,bogstaver.Length-1);
int rand2 = rand.Next(0,bogstaver.Length-1);
string bogstav = bogstaver.Substring(rand1, 1);
bogstav += bogstaver.Substring(rand2, 1);

string datoTid = DateTime.Now.Day.ToString();
datoTid += DateTime.Now.Month.ToString();
datoTid += DateTime.Now.Year.ToString();
datoTid += DateTime.Now.Hour.ToString();
datoTid += DateTime.Now.Minute.ToString();
datoTid += DateTime.Now.Second.ToString();

string num = "";
for (int i = 0; i < 4; i++)
{
num += rand.Next(0, 10).ToString();
}

return num + bogstav + datoTid;
}

private void confirmOrder() {
email =
Request.Form["dnn$ctr372$Checkout$ctl10$addressBilling$txtEmail"]
;
txtHiddenEmail.Text = email;
kommentar =
Request.Form["dnn$ctr372$Checkout$ctl10$addressBilling$txtComment
s"];
txtHiddenKommentar.Text = kommentar;
this.Page.Validate("xxx");
orderNumber = ordrenummer();
if (this.Page.IsValid)
{
// ordren skal gemmes i en database
saveOrderToDB(RadioButtonList1.SelectedIndex);

if (RadioButtonList1.SelectedIndex == 0) //
Dankort
{
//
https://pay.scannet.dk/265000070/order.htm?ordrnr=" + orderId + "

string scr = @"<script> function success() {
__doPostBack('" + ConfirmPayment.UniqueID + "', ''); } function
openWin() {
window.open('https://pay.scannet.dk/xxx/order.htm?ordrnr=" +
orderNumber +
"','','statusbar=1,statusbar,status,width=400,height=400,scrollba
rs=yes,statusbar=yes,status=yes'); } openWin(); </script>";
Page.RegisterClientScriptBlock("cardwindow",
scr);



lblPaymentInfo.Text = "Tillad adgang til
popupvindue med kortbetaling. Hvis du har popupblokker, skal du
tillade adgang.";

}
else if (RadioButtonList1.SelectedIndex == 1) //
Bankoverførsel
{
OrderInfo i =
base.CheckoutControl.GetFinalizedOrderInfo();

string order = orderConf();

lblOrderInfo.Text = order;

base.CheckoutControl.Hide();
this.FinalMessage.Visible = true;
this.PaymentOptions.Visible = false;
this.panelCardPayment.Visible = false;
CurrentCart.ClearItems(base.PortalId);
this.SetOrderIdCookie(-1);
}
}
//else
//{
// foreach (IValidator val in Page.Validators)
// {
// Response.Write(val.ErrorMessage + " " +
val.IsValid + "<br/>");
//
System.Web.UI.WebControls.RequiredFieldValidator rVal =
(System.Web.UI.WebControls.RequiredFieldValidator)val;
// Response.Write(rVal.ControlToValidate);
// }
//}
}

private void saveOrderToDB(int type)
{
IAddressInfo billingAddress =
this.CheckoutControl.BillingAddress;
OrderInfo orderInfo = this.CheckoutControl.OrderInfo;

string connectionString = "DRIVER={MySQL ODBC 3.51
Driver}; SERVER=localhost; DATABASE=data; UID=xxx;
PASSWORD=gn2699; OPTION=3;";

// generel information gemmes her.
string sql = "INSERT INTO ordre
(navn,adresse,postnr,byen,telefon,land,email,noter,dato,klokken,s
tyresystem,sprog,valuta,betaling,ordrenummer,produkt,antal,cd,tot
al,ip,cd2,forhandler,swingit,McD,haefte,udslagsmaatte,gammel_lice
ns, gebyr, newpage)
VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
";

string sprog = "da";
string betaling;
if (type == 0)
betaling = "kreditkort";
else
betaling = "bank";

OdbcConnection conn = new
OdbcConnection(connectionString);
OdbcCommand comm = new OdbcCommand(sql, conn);

comm.Parameters.Add("@navn", OdbcType.Text).Value =
billingAddress.Name;
comm.Parameters.Add("@adresse", OdbcType.Text).Value
= billingAddress.Address1;
comm.Parameters.Add("@postnr", OdbcType.Text).Value =
billingAddress.PostalCode;
comm.Parameters.Add("@byen", OdbcType.Text).Value =
billingAddress.City;
comm.Parameters.Add("@telefon", OdbcType.Text).Value
= billingAddress.Phone1;
comm.Parameters.Add("@land", OdbcType.Text).Value =
billingAddress.CountryCode;
comm.Parameters.Add("@email", OdbcType.Text).Value =
txtHiddenEmail.Text;
comm.Parameters.Add("@noter", OdbcType.Text).Value =
txtHiddenKommentar.Text;
comm.Parameters.Add("@dato", OdbcType.Date).Value =
DateTime.Now.Date;
comm.Parameters.Add("@klokken", OdbcType.Time).Value
= DateTime.Now.TimeOfDay;
comm.Parameters.Add("@styresystem",
OdbcType.Text).Value = "Windows";
comm.Parameters.Add("@sprog", OdbcType.Text).Value =
sprog;
comm.Parameters.Add("@valuta", OdbcType.Text).Value =
208;
comm.Parameters.Add("@betaling", OdbcType.Text).Value
= betaling;
comm.Parameters.Add("@ordrenummer",
OdbcType.Text).Value = orderNumber;
comm.Parameters.Add("@produkt", OdbcType.Int).Value =
0;
comm.Parameters.Add("@antal", OdbcType.Int).Value =
0;
comm.Parameters.Add("@cd", OdbcType.Int).Value = 0;
comm.Parameters.Add("@total", OdbcType.Double).Value
= orderInfo.OrderTotal + orderInfo.ShippingCost;
comm.Parameters.Add("@ip", OdbcType.Text).Value =
Request.UserHostAddress;
comm.Parameters.Add("@cd2", OdbcType.Int).Value = 0;
comm.Parameters.Add("@forhandler",
OdbcType.Text).Value = "";
comm.Parameters.Add("@swingit", OdbcType.Int).Value =
0;
comm.Parameters.Add("@McD", OdbcType.Int).Value = 0;
comm.Parameters.Add("@haefte", OdbcType.Int).Value =
0;
comm.Parameters.Add("@udslagsmaate",
OdbcType.Int).Value = 0;
comm.Parameters.Add("@gammel_licens",
OdbcType.Text).Value = "";
comm.Parameters.Add("@gebyr", OdbcType.Double).Value
= orderInfo.ShippingCost;
comm.Parameters.Add("@newpage", OdbcType.Int).Value =
1;


conn.Open();
comm.ExecuteNonQuery();
comm.Dispose();

// de specifikke varer gemmes i tabel for sig
ArrayList orderDetails = new
OrderController().GetOrderDetails(orderInfo.OrderID);
foreach (OrderDetailsInfo info in orderDetails)
{
sql = "INSERT INTO ordre_specifikation
(ordrenummer, produkt, antal, cost) VALUES(?,?,?,?)";
comm = new OdbcCommand(sql, conn);
int quantity = info.Quantity;
string product = info.ModelName;
decimal cost = info.UnitCost;

comm.Parameters.Add("@ordrenummer",
OdbcType.VarChar).Value = orderNumber;
comm.Parameters.Add("@produkt",
OdbcType.VarChar).Value = product;
comm.Parameters.Add("@antal", OdbcType.Int).Value
= quantity;
comm.Parameters.Add("@cost",
OdbcType.Double).Value = Decimal.ToDouble(cost);
comm.ExecuteNonQuery();
comm.Dispose();
}
conn.Close();
}

private string orderConf()
{
// Getting information from Database
string connectionString = "DRIVER={MySQL ODBC 3.51
Driver}; SERVER=localhost; DATABASE=data; UID=xxx;
PASSWORD=gn2699; OPTION=3;";
OdbcConnection conn = new
OdbcConnection(connectionString);
conn.Open();
string sql = "SELECT * FROM ordre WHERE ordrenummer =
?;";
OdbcCommand comm = new OdbcCommand(sql, conn);
comm.Parameters.Add("@ordrenummer",
OdbcType.Text).Value = orderNumber;

OdbcDataReader rdr = comm.ExecuteReader();

if (!rdr.HasRows)
return "Ordren eksisterer ikke.";
rdr.Read();

string navn = rdr["navn"].ToString();
string adresse = rdr["adresse"].ToString();
string postnr = rdr["postnr"].ToString();
string by = rdr["byen"].ToString();
string telefon = rdr["telefon"].ToString();
string land = rdr["land"].ToString();
string email = rdr["email"].ToString();
string noter = rdr["noter"].ToString();
DateTime dato = (DateTime)rdr["dato"];
TimeSpan klokken = (TimeSpan)rdr["klokken"];
string styresystem = rdr["styresystem"].ToString();
string sprog = rdr["sprog"].ToString();
string valuta = rdr["valuta"].ToString();
string betaling = rdr["betaling"].ToString();
string ordrenummer = rdr["ordrenummer"].ToString();
double gebyr = Double.Parse(rdr["gebyr"].ToString());
string ip = rdr["ip"].ToString();

ArrayList products = new ArrayList();

rdr.Close();
rdr.Dispose();
comm.Dispose();

// specifikke produkter
sql = "SELECT * FROM ordre_specifikation WHERE
ordrenummer = ?;";
comm = new OdbcCommand(sql, conn);
comm.Parameters.Add("@ordrenummer",
OdbcType.Text).Value = ordrenummer;

rdr = comm.ExecuteReader();
while (rdr.Read())
{
product p = new product();
p.name = rdr["produkt"].ToString();
p.cost = (double)rdr["cost"];
p.quantity = (int)rdr["antal"];
products.Add(p);
}


string valutaTegn = "DKK";




string confirmation = "<style>td{font-family:
verdana; font-size:11pt;}</style><div width=\"85%\"
style=\"text-align: left;\"><hr><font
family=\"Verdana\"><big><big><center>FAKTURA</center></big></big>
<big><big></font><hr>";
confirmation += "<b>Faktura/Ordrenummer: " +
ordrenummer + "</b><br/><br/>";
confirmation += "<big><b>Personlige
oplysninger</b></big><hr>";
confirmation += "<table width=\"80%\">";
confirmation += "<tr><td><b>Navn:</b></td><td>" +
navn + "</td></tr>";
confirmation += "<tr><td><b>Adresse:</b></td><td>" +
adresse + "</td></tr>";
confirmation += "<tr><td>&nbsp;</td><td>" + postnr +
" " + by + "</td></tr>";
confirmation += "<tr><td>&nbsp;</td><td>" + land +
"</td></tr>";
confirmation += "<tr><td><b>Telefon:</b></td><td>" +
telefon + "</td></tr>";
confirmation += "<tr><td><b>E-mail:</b></td><td>" +
email + "</td></tr>";
confirmation += "</table>";
confirmation += "<hr><big><b>Ordre</b></big><hr>";
confirmation += "<table width=\"100%\">";
confirmation += "<tr><td
width=\"65%\"><b>Produkt</b></td><td><b>Antal</b></td><td><b>Pris
</b></td><td><b>Subtotal</b></td></tr>";
double subtotal = 0;
foreach(product p in products) {
double pTotal = p.quantity * p.cost;
subtotal += pTotal;
confirmation += "<tr><td>" + p.name + "</td><td>"
+ p.quantity + "</td><td>" + valutaTegn + " " + p.cost +
"</td><td>" + valutaTegn + " " + pTotal + "</td></tr>";
}
confirmation += "<tr><td
colspan=\"4\"><hr></td></tr>";
confirmation += "<tr><td colspan=\"3\"
align=\"right\">Subtotal:</td><td>" + valutaTegn + " " + subtotal
+ "</td></tr>";
confirmation += "<tr><td colspan=\"3\"
align=\"right\">Gebyr:</td><td>" + valutaTegn + " " + gebyr +
"</td></tr>";
confirmation += "<tr><td colspan=\"3\"
align=\"right\">Total:</td><td>" + valutaTegn + " " + (subtotal +
gebyr) + "</td></tr>";
confirmation += "</table>";
confirmation += "<br/><br/>";
if (betaling.Equals("bank"))
{
confirmation += "Betalingsmetode:
Banktransaktion<br/><br/>";
confirmation += "Din ordre bliver fremsendt med
post inden for 72 timer efter vi har modtaget din betaling. Har
du bestilt et produkt der skal bruge licenskode vil denne blive
sendt til din email-adresse inden for 72 timer efter vi har
modtaget din betaling. confirmation +=
"<br/><br/>";
confirmation += "Total-prisen for bestillingen
skal indbetales paa bankkonto: <br/><i><u> }
else
{
confirmation += "NB. DIN KVITTERING, SOM SENDES
PR. MAIL KAN RISIKERE AT HAVNE I DIN SPAMMAIL!<br/><br/>";
confirmation += "Betalingsmetode:
Kreditkort<br/><br/>";
confirmation += "Din ordre bliver fremsendt med
post inden for 72 timer. Har du bestilt et produkt der skal bruge
licenskode vil denne blive sendt til din email-adresse inden for
72 timer. confirmation += "<br/><br/>";
}
confirmation += "Ordren blev foretaget fra IP: " + ip
+ " klokken " + DateTime.Now.TimeOfDay.ToString().Substring(0,8)
+ " d. " + dato.Date.ToString().Substring(0,10);
confirmation += "<br/><br/>";
confirmation += "<center><i>Tak fordi du handlede hos
xxx</i></center>";
confirmation += "<br/><br/>Med venlig
hilsen<br/><br/>";
confirmation += "xxx<br/>";
confirmation += "<a
href=\"http://www.xxx.dk/\">www.xxx.dk

";
confirmation += "Support: <a
href=\"xxx\">xxx</a><br/><br/>";

confirmation += "<b>xxx</b><br/>";
confirmation += "xxx<br/>";
confirmation += "Tlf. xxx)<br/>";
confirmation += "xxx";

SmtpClient client = new
SmtpClient((string)Globals.HostSettings["SMTPServer"]);
new DotNetNuke.Services.Mail.Mail();
client.UseDefaultCredentials = false;
client.Port = 0x19;
//client.EnableSsl = false;
//client.Credentials = credential;
MailMessage message = new MailMessage();
try
{
StoreInfo storeData =
this.CheckoutControl.StoreData;
string defaultEmailAddress =
storeData.DefaultEmailAddress;
MailAddress address = new
MailAddress(defaultEmailAddress, "xxx");
message.From = address;
message.To.Add(email);
string str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderSub
ject", base.LocalResourceFile);
message.Subject = string.Format(str4,
storeData.Name);
message.IsBodyHtml = true;
message.BodyEncoding = Encoding.UTF8;
message.Body = confirmation;
client.Send(message);
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderSub
jectToAdmin", base.LocalResourceFile);
message.Subject = string.Format(str4,
orderNumber);
message.To.Clear();
message.To.Add(defaultEmailAddress);
message.Priority = MailPriority.High;
client.Send(message);
}
catch (Exception e)
{
Response.Write("Exception @ mail send");
Response.Write(e.ToString());
}

return confirmation;
}

struct product
{
public string name;
public double cost;
public int quantity;
}

/* private string orderConf(bool bankoverfoersel) {
StringBuilder builder = new StringBuilder();
string str = "";
string defaultEmailAddress = "";
string addresses = "";
StoreInfo storeData =
this.CheckoutControl.StoreData;
IAddressInfo billingAddress =
this.CheckoutControl.BillingAddress;
IAddressInfo shippingAddress =
this.CheckoutControl.ShippingAddress;
try {
if
(shippingAddress.Address1.Equals(DBNull.Value) ||
(shippingAddress.Address1.Length == 0)) {
shippingAddress = billingAddress;
}
} catch (NullReferenceException) {
shippingAddress = billingAddress;
}
OrderInfo orderInfo =
this.CheckoutControl.OrderInfo;
if (storeData == null) {
storeData = new
StoreController().GetStoreInfo(base.PortalId);
}
NumberFormatInfo provider =
(NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone();
if (storeData.CurrencySymbol != string.Empty)
{
provider.CurrencySymbol =
storeData.CurrencySymbol;
}
UserInfo user = new
UserController().GetUser(base.PortalId, orderInfo.CustomerID);
if (((storeData != null) && (orderInfo !=
null)) && (user != null)) {
defaultEmailAddress =
storeData.DefaultEmailAddress;
addresses = txtHiddenEmail.Text;
ArrayList orderDetails = new
OrderController().GetOrderDetails(orderInfo.OrderID);
TabInfo info7 = new
TabController().GetTab(storeData.ShoppingCartPageID,
storeData.PortalID, true);
builder.Append("<div style=\"text-align:
left\">");
str =
string.Format(DotNetNuke.Services.Localization.Localization.GetSt
ring("OrderEmailHeader", base.LocalResourceFile),
base.PortalSettings.PortalName, info7.TabName,
defaultEmailAddress);
builder.Append("<h2>" + str +
"</h2><br/>\r\n");
string str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderNum
ber", base.LocalResourceFile);
builder.Append("<i>" + str4 + " " +
orderNumber);
builder.Append("<br/>\r\n");
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderDat
e", base.LocalResourceFile);
string format =
DotNetNuke.Services.Localization.Localization.GetString("OrderDat
eFormat", base.LocalResourceFile);
builder.Append(str4 + " " +
orderInfo.OrderDate.ToString(format) + "</i>");
builder.Append("<br/>\r\n");

if (bankoverfoersel)
{
builder.Append("Din ordre bliver
fremsendt med post inden for 72 timer efter vi har modtaget din
indbetaling. Har du bestilt et produkt der skal bruge licenskode
vil denne blive sendt til din email-adresse inden for 72 timer
efter vi har modtaget din indbetaling. )");
builder.Append("<br/>\r\n");
builder.Append("Total-prisen for
bestillingen skal indbetales på bankkonto: xxx<br>\r\n");
}
else
{
builder.Append("Din ordre bliver
fremsendt med post inden for 72 timer. Har du bestilt et produkt
der skal bruge licenskode vil denne blive sendt til din
email-adresse inden for 72 timer. )");
builder.Append("<br/>\r\n");
}

builder.Append("<br/>\r\n");
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderCon
tents", base.LocalResourceFile);
builder.Append(str4);
builder.Append("<br/>\r\n");
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderIte
ms", base.LocalResourceFile);
builder.Append("<table>");
builder.Append("<tr><td
style=\"font-family: verdana; font-size: 11pt;\">Antal</td><td
style=\"font-family: verdana; font-size: 11pt;\">Produkt</td><td
style=\"font-family: verdana; font-size:
11pt;\">Enhedspris</td></tr>");
foreach (OrderDetailsInfo info8 in
orderDetails) {
builder.Append("<tr>");
builder.Append(string.Format(str4,
info8.Quantity, info8.ModelName, info8.UnitCost.ToString("C",
provider)));
builder.Append("</tr>");
}
builder.Append("</table>");
builder.Append("<br/>\r\n");
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderSub
Total", base.LocalResourceFile);
builder.Append(string.Format(str4,
orderInfo.OrderTotal.ToString("C", provider)));
builder.Append("<br/>\r\n");
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderShi
pping", base.LocalResourceFile);
builder.Append(string.Format(str4,
orderInfo.ShippingCost.ToString("C", provider)));
if (orderInfo.Tax > 0M) {
builder.Append("<br/>\r\n");
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderTax
", base.LocalResourceFile);
builder.Append(string.Format(str4,
orderInfo.Tax.ToString("C", provider)));
}
builder.Append("<br/>\r\n");
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderTot
al", base.LocalResourceFile);
builder.Append(string.Format(str4,
orderInfo.GrandTotal.ToString("C", provider)));
builder.Append("<br/>\r\n");
builder.Append("<br/>\r\n");
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderBil
lingAddress", base.LocalResourceFile);
builder.Append(str4);
builder.Append("<br/>\r\n");
builder.Append(billingAddress.Name);
builder.Append("<br/>\r\n");
builder.Append(billingAddress.Address1);
if (billingAddress.Address2.Length > 0) {
builder.Append("<br/>\r\n");

builder.Append(billingAddress.Address2);
}
builder.Append("<br/>\r\n");
builder.Append(billingAddress.PostalCode +
" " + billingAddress.City);
builder.Append("<br/>\r\n");
//
builder.Append(billingAddress.CountryCode);
// builder.Append("<br/>\r\n");
builder.Append("E-mail: " + addresses);
builder.Append("<br/>\r\n");
builder.Append("Bemærkninger: " +
kommentar);
builder.Append("<br/>\r\n");
builder.Append("<br/>\r\n");

/*
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderShi
ppingAddress", base.LocalResourceFile);
builder.Append(str4);
builder.Append("<br/>\r\n");
builder.Append(shippingAddress.Name);
builder.Append("<br/>\r\n");
builder.Append(shippingAddress.Address1);
builder.Append("<br/>\r\n");
if (shippingAddress.Address2.Length > 0) {

builder.Append(shippingAddress.Address2);
builder.Append("<br/>\r\n");
}
builder.Append(shippingAddress.City);
builder.Append("<br/>\r\n");

builder.Append(shippingAddress.RegionCode);
builder.Append("<br/>\r\n");

builder.Append(shippingAddress.PostalCode);
builder.Append("<br/>\r\n");

builder.Append(shippingAddress.CountryCode);
builder.Append("<br/>\r\n");
builder.Append("<br/>\r\n");* /
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderTer
msOfUse", base.LocalResourceFile);
builder.Append(str4);
builder.Append("<br/>\r\n");
builder.Append("<br/>\r\n");
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderTha
nks", base.LocalResourceFile);
builder.Append(str4);
builder.Append("<br/>\r\n");
builder.Append("<br/>\r\n");
builder.Append("http://" +
base.PortalSettings.PortalAlias.HTTPAlias);
builder.Append("<br/>\r\n");
SmtpClient client = new
SmtpClient((string)Globals.HostSettings["SMTPServer"]);
new DotNetNuke.Services.Mail.Mail();
// NetworkCredential credential = new
NetworkCredential((string)Globals.HostSettings["SMTPUsername"],
(string)Globals.HostSettings["SMTPPassword"]);
client.UseDefaultCredentials = false;
client.Port = 0x19;
//client.EnableSsl = false;
//client.Credentials = credential;
MailMessage message = new MailMessage();
try {
MailAddress address = new
MailAddress(defaultEmailAddress, "xxx");
message.From = address;
message.To.Add(addresses);
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderSub
ject", base.LocalResourceFile);
message.Subject = string.Format(str4,
storeData.Name);
message.IsBodyHtml = true;
message.BodyEncoding = Encoding.UTF8;
message.Body = builder.ToString();
client.Send(message);
str4 =
DotNetNuke.Services.Localization.Localization.GetString("OrderSub
jectToAdmin", base.LocalResourceFile);
message.Subject = string.Format(str4,
orderNumber);
message.To.Clear();
message.To.Add(defaultEmailAddress);
message.Priority = MailPriority.High;
client.Send(message);
} catch (Exception e) {
Response.Write("Exception @ mail
send");
Response.Write(e.ToString());
}
builder.Append("</div>");
}
return builder.ToString();
}*/

private void InitializeComponent() {
}

protected override void OnInit(EventArgs e) {
this.InitializeComponent();
base.OnInit(e);
}

private void SetOrderIdCookie(int OrderID) {
HttpCookie cookie =
HttpContext.Current.Request.Cookies[this.CookieKey];
if (cookie == null) {
cookie = new HttpCookie(this.CookieKey);
}
cookie["OrderID"] = OrderID.ToString();
HttpContext.Current.Response.Cookies.Add(cookie);
base.Session["OrderID"] = OrderID;
}

private string CookieKey {
get {
return (CookieName + base.PortalId);
}
}
protected void LinkButton1_Click(object sender, EventArgs
e)
{
confirmPayment();
}
}
}

--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! => http://www.html.dk/tutorials

 
 
Søg
Reklame
Statistik
Spørgsmål : 177577
Tips : 31968
Nyheder : 719565
Indlæg : 6409071
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste