public ActionResult OrderBill()
        {
            int    a        = (int)Session["UserID"];
            var    listcash = BillAction.ListCartDetail(a);
            var    detail   = listcash.FirstOrDefault();
            string text     = "";

            foreach (var item in listcash)
            {
                text += item.Book.Name + "<br/>" + item.Price + "\n" + item.Count;
            }
            CashAction.Order(a);
            string content = System.IO.File.ReadAllText(Server.MapPath("~/client/template/neworder.html"));

            Session["alert"] = "ok";
            content          = content.Replace("{{Name}}", "sadsada");
            content          = content.Replace("{{product}}", text);
            content          = content.Replace("{{Content}}", "*****@*****.**");
            content          = content.Replace("{{totalcost}}", Convert.ToString(detail.Bill.TotalCost));
            var toEmail = ConfigurationManager.AppSettings["ToEmailAddress"].ToString();

            new MailHelper().SendMail("*****@*****.**", "Đơn Đặt Hàng", content);
            new MailHelper().SendMail(toEmail, "Đơn Đặt Hàng", content);
            return(RedirectToAction("ViewCart", "Cart"));
        }
 public ActionResult OrderBill()
 {
     try
     {
         int a        = (int)Session["UserID"];
         var listcash = BillAction.ListCartDetail(a);
         var detail   = listcash.FirstOrDefault();
         CashAction.Order(a);
         return(RedirectToAction("ViewCart", "Cart"));
     } catch {
         return(RedirectToAction("ViewCart", "Cart"));
     }
 }