当前位置: 首页>>代码示例>>C#>>正文


C# MySqlDatabase.CreateQuotation方法代码示例

本文整理汇总了C#中MySqlDatabase.CreateQuotation方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlDatabase.CreateQuotation方法的具体用法?C# MySqlDatabase.CreateQuotation怎么用?C# MySqlDatabase.CreateQuotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MySqlDatabase的用法示例。


在下文中一共展示了MySqlDatabase.CreateQuotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendQuotation

        protected void SendQuotation(object sender, CommandEventArgs e)
        {
            long productId = 0;
            int credits = 0;
            if (QuotationAmount.Text.Length > 0)
            {
                int tmp = 0;
                if (int.TryParse(QuotationAmount.Text, out tmp))
                    credits = tmp;
            }

            if (Session["quotation.pid"] != null)
                productId = (long)Session["quotation.pid"];

            if (credits > 0)
            {
                // Send e-mail with quotation request
                Config cfg = new Config();
                cfg.Load(Server.MapPath("~/Config/trackprotect.config"));

                string emailTo = cfg["email.sales"];
                StringBuilder body = new StringBuilder();

                // Get user/client information
                using (Database db = new MySqlDatabase())
                {
                    long userId = Util.UserId;
                    UserInfo ui = db.GetUser(userId);
                    ClientInfo ci = db.GetClientInfo(userId);
                    body.Append("<html><head></head><body><p><div style=\"background-color:#E6E6E6;\"><table><tr><td>");
                    body.Append("<img src=\"" + ConfigurationManager.AppSettings["EmailHeaderLogo"] + "\" alt=\"logo\"/></td><td><span>");
                    body.Append("<a style=\"color:#E4510A; margin-left:450px;\" href=\"" + ConfigurationManager.AppSettings["EmailmailToLink"] + "\" >" + ConfigurationManager.AppSettings["EmailmailToLink"] + "</a>");
                    body.Append("<br><a style=\"color:#E4510A; margin-left:450px;\" href=\"" + ConfigurationManager.AppSettings["SiteNavigationLink"] + "\">" + ConfigurationManager.AppSettings["SiteNavigationLink"] + "</a>");
                    body.Append("</span></td></tr></table></div><br><br>");

                    body.Append(ci.GetFullName());
                    body.AppendFormat("heeft een offerte aangevraagd voor {0} credits.\r\n", QuotationAmount.Text);
                    body.AppendFormat("e-mail         : {0}\r\n", ui.Email);
                    body.AppendFormat("e-mail receipt : {0}\r\n", ci.EmailReceipt);
                    body.AppendFormat("user-id        : {0}\r\n", ui.UserId);
                    body.AppendFormat("client-id      : {0}\r\n", ci.ClientId);

                    body.Append("<br><br><img src=\"" + ConfigurationManager.AppSettings["EmailFooterLogo"] + "\" alt=\"logo\"/>");
                    body.Append("<a href=\"" + ConfigurationManager.AppSettings["EmailFBlink"] + "\"><img src=\"" + ConfigurationManager.AppSettings["EmailFBLogo"] + "\" alt=\"facebook\"></img></a>");
                    body.Append("<a href=\"" + ConfigurationManager.AppSettings["EmailTwitterLink"] + "\"><img src=\"" + ConfigurationManager.AppSettings["EmailTwitterLogo"] + "\" alt=\"twitter\"></img></a>");
                    body.Append("<a href=\"" + ConfigurationManager.AppSettings["EmailSoundCloudLink"] + "\"><img src=\"" + ConfigurationManager.AppSettings["EmailSoundCloudLogo"] + "\" alt=\"soundcloud\"></img></a>");
                    body.Append("<br><br>Trackprotect is “a RHOS Initiative” – Robin Hood of Sound – A Sound Revolution.<br>");

                    if (productId == 0)
                        productId = 4;

                    db.CreateQuotation(ui.UserId, credits, productId, string.Format("Quotation for {0} credits", QuotationAmount.Text));
                }

                Util.SendEmail(new string[] { emailTo }, "[email protected]", Resources.Resource.Quotation, body.ToString(), new string[] { }, 0);
                Response.Redirect("~/Member/QuotationSuccess.aspx", false);
            }
            else
            {
                ErrorMessage.Text = Resources.Resource.InvalidAmount;
            }
        }
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:62,代码来源:Quotation.aspx.cs


注:本文中的MySqlDatabase.CreateQuotation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。