本文整理汇总了C#中MySqlDatabase.UpdateQuotation方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlDatabase.UpdateQuotation方法的具体用法?C# MySqlDatabase.UpdateQuotation怎么用?C# MySqlDatabase.UpdateQuotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySqlDatabase
的用法示例。
在下文中一共展示了MySqlDatabase.UpdateQuotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StoreQuotation
protected void StoreQuotation(object sender, CommandEventArgs e)
{
long transactionId = 0, userId = 0;
if (Request.Params["tid"] != null)
transactionId = Convert.ToInt64(Request.Params["tid"]);
if (Request.Params["uid"] != null)
userId = Convert.ToInt64(Request.Params["uid"]);
decimal amount = 0m;
if (!decimal.TryParse(Amount.Text, out amount))
amount = 0m;
if (amount > 0m)
{
Config config = new Config();
config.Load(HttpContext.Current.Server.MapPath("~/Config/trackprotect.config"));
using (Database db = new MySqlDatabase())
{
string from = config["email.sales"];
if (string.IsNullOrEmpty(from))
from = "[email protected]";
UserInfo ui = db.GetUser(userId);
ClientInfo ci = db.GetClientInfo(userId);
db.UpdateQuotation(transactionId, amount);
Transaction transaction = db.GetQuotation(transactionId);
string body = string.Empty;
string paymentLink = string.Empty;
paymentLink = string.Format(Resources.Resource.QuoteReplyLink, transactionId, transaction.ProductId);
using (TextReader rdr = new StreamReader(Server.MapPath(Resources.Resource.emlQuoteReplyBody)))
{
string fname = ci.FirstName;
body = rdr.ReadToEnd();
body = body.Replace("{%EmailHeaderLogo%}", ConfigurationManager.AppSettings["EmailHeaderLogo"]);
body = body.Replace("{%EmailmailToLink%}", ConfigurationManager.AppSettings["EmailmailToLink"]);
body = body.Replace("{%SiteNavigationLink%}", ConfigurationManager.AppSettings["SiteNavigationLink"]);
body = body.Replace("{%EmailFooterLogo%}", ConfigurationManager.AppSettings["EmailFooterLogo"]);
body = body.Replace("{%EmailFBlink%}", ConfigurationManager.AppSettings["EmailFBlink"]);
body = body.Replace("{%EmailFBLogo%}", ConfigurationManager.AppSettings["EmailFBLogo"]);
body = body.Replace("{%EmailTwitterLink%}", ConfigurationManager.AppSettings["EmailTwitterLink"]);
body = body.Replace("{%EmailTwitterLogo%}", ConfigurationManager.AppSettings["EmailTwitterLogo"]);
body = body.Replace("{%EmailSoundCloudLink%}", ConfigurationManager.AppSettings["EmailSoundCloudLink"]);
body = body.Replace("{%EmailSoundCloudLogo%}", ConfigurationManager.AppSettings["EmailSoundCloudLogo"]);
body = body.Replace("{%salutation%}", ci.GetFullName());
body = body.Replace("{%username%}", ui.Email);
body = body.Replace("{%firstname%}", ci.FirstName);
body = body.Replace("{%lastname%}", ci.LastName);
body = body.Replace("{%addressline1%}", ci.AddressLine1);
body = body.Replace("{%addressline2%}", ci.AddressLine2);
body = body.Replace("{%zipcode%}", ci.ZipCode);
body = body.Replace("{%city%}", ci.City);
body = body.Replace("{%state%}", ci.State);
body = body.Replace("{%country%}", ci.Country);
body = body.Replace("{%telephone%}", ci.Telephone);
body = body.Replace("{%cellular%}", ci.Cellular);
body = body.Replace("{%email%}", ui.Email);
body = body.Replace("{%ownerkind%}", ci.OwnerKind);
body = body.Replace("{%twitterid%}", ci.TwitterId);
body = body.Replace("{%facebookid%}", ci.FacebookId);
body = body.Replace("{%senacode%}", ci.SenaCode);
body = body.Replace("{%isrccode%}", ci.IsrcCode);
body = body.Replace("{%link%}", paymentLink);
}
Util.SendEmail(new string[] { ui.Email }, from, Resources.Resource.emlQuoteReplySubject, body, null,0);
}
}
}