Exemplo n.º 1
0
 public ActionResult Message(ContactMessage m)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append("标题:" + m.Title + "<br>");
     sb.Append("内容:" + m.Content + "<br>");
     sb.Append("Email:" + m.Email + "<br>");
     sb.Append("电话:" + m.Phone + "<br>");
     sb.Append("姓名" + m.Name + "<br>");
     if (EmailHelper.SendEmail("*****@*****.**", m.Title, sb.ToString()))
     {
         ViewBag.Message = "操作成功!我们的业务员会及时的联系您!";
     }
     else
     {
         ViewBag.Message = "操作失败!试试换种方式和我们联系吧!";
     }
     return View();
 }
Exemplo n.º 2
0
        public ActionResult Message(ContactMessage m)
        {
            SqlConfig config = new SqlConfig(DataDriverType.Sqlite, "SoftWare_", "", "~/App_Data/db.db");
            DataOperator dop = new DataOperator(config);

            try
            {
                m.CMID = DateTime.Now.ToString("yyyyMMdd") + dop.Count<ContactMessage>();
                dop.Insert(m);
                dop.Commit();
                ViewBag.Message = "操作成功!我们的业务员会及时的联系您!";
            }
            catch
            {
                ViewBag.Message = "操作失败!试试换种方式和我们联系吧!";
            }
            return View();
        }