Example #1
0
        public ActionResult Edit()
        {
            var dao   = new LienHeDAO();
            var model = dao.LayThongTinLienHe();

            return(View(model));
        }
Example #2
0
        public ActionResult Index(FormCollection collection)
        {
            string fullname    = collection.Get("fullName");
            string email       = collection.Get("email");
            string phoneNumber = collection.Get("phonenumber");
            string address     = collection.Get("address");
            string content     = collection.Get("content");



            LienHe lh = new LienHe()
            {
                hoten   = fullname,
                email   = email,
                sdt     = phoneNumber,
                diachi  = address,
                noidung = content
            };

            LienHeDAO lienHeDAO = new LienHeDAO();

            lienHeDAO.AddLH(lh);

            TempData["msg"] = "<script>alert('Shop đã nhận liên hệ của quý khách');</script>";

            return(View());
        }
        // GET: Admin/Giothieu
        public ActionResult Index()
        {
            var dao   = new LienHeDAO();
            var model = dao.ListAll(1);

            return(View(model));
        }
        // GET: Admin/PhanHoiKH
        public ActionResult Index(string searchString, int page = 1, int pageSize = 10)
        {
            var dao   = new LienHeDAO();
            var model = dao.ListAllPaging(searchString, page, pageSize);

            ViewBag.SearchString = searchString;
            return(View(model));
        }
        public ActionResult Edit(long id)
        {
            var dao     = new LienHeDAO();
            var content = dao.ListAll(id);


            return(View(content));
        }
        public ActionResult Edit(GioiThieu model)
        {
            if (ModelState.IsValid)
            {
                var dao = new LienHeDAO();


                var result = dao.Edit(model);
                if (result)
                {
                    SetAlert("Sửa giới thiệu thành công", "success");
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Cập nhật giới thiệu không thành công");
                }
            }

            return(View());
        }
Example #7
0
        public JsonResult Send(string name, string mobile, string address, string email, string content)
        {
            var feedback = new tbl_Feedback();

            feedback.sTenKH       = name;
            feedback.sEmail       = email;
            feedback.dNgayTao     = DateTime.Now;
            feedback.sSoDienThoai = mobile;
            feedback.sNoiDung     = content;
            feedback.sDiaChi      = address;
            string mailcontent = System.IO.File.ReadAllText(Server.MapPath("~/Assets/Client/Templates/ContactMail.html"));

            mailcontent = mailcontent.Replace("{{sTenNguoiNhan}}", name);
            mailcontent = mailcontent.Replace("{{sSoDienThoai}}", mobile);
            mailcontent = mailcontent.Replace("{{sEmail}}", email);
            mailcontent = mailcontent.Replace("{{sDiaChi}}", address);
            mailcontent = mailcontent.Replace("{{sNoiDung}}", content);
            var toEmail = ConfigurationManager.AppSettings["ToEmailAddress"].ToString();

            new Mail().SendMail(email, "Thông báo mới từ MyHands", mailcontent);
            new Mail().SendMail(toEmail, "Lượt đăng ký mới", mailcontent);
            var id = new LienHeDAO().InsertFeedBack(feedback);

            if (id > 0)
            {
                return(Json(new
                {
                    status = true
                }));
                //send mail
            }

            else
            {
                return(Json(new
                {
                    status = false
                }));
            }
        }
        public ActionResult Index(string ten, string sdt, string email, string ghichu)
        {
            var dao   = new LienHeDAO();
            var model = dao.add(ten, sdt, email, ghichu);



            string content = System.IO.File.ReadAllText(Server.MapPath("~/assets/client/template/phanhoi.html"));

            content = content.Replace("{{CustomerName}}", ten);
            content = content.Replace("{{Phone}}", sdt);
            content = content.Replace("{{Email}}", email);
            content = content.Replace("{{message}}", ghichu);

            var toEmail = ConfigurationManager.AppSettings["ToEmailAddress"].ToString();


            new GuiMail().SendMail(toEmail, "Liên hệ từ khách hàng  mobileShop:  ", content);



            return(View());
        }
Example #9
0
        public ActionResult DiaChi()
        {
            var model = new LienHeDAO().ListAll(1);

            return(PartialView(model));
        }
Example #10
0
        // GET: Contact
        public ActionResult Index()
        {
            var model = new LienHeDAO().getThongTinLienHe();

            return(View(model));
        }
Example #11
0
        public ActionResult _tinnhan()
        {
            var model = new LienHeDAO().ListAlltn();

            return(PartialView(model));
        }