예제 #1
0
        // GET: Admin/Email
        public ActionResult Index()
        {
            var dao   = new emailDao();
            var model = dao.ListAllPaging();

            return(View(model));
        }
예제 #2
0
        public ActionResult Create(Email model)
        {
            if (ModelState.IsValid)
            {
                var dao = new emailDao();

                long id = dao.Insert(model);
                if (id > 0)
                {
                    return(RedirectToAction("Index", "Email"));
                }
                else
                {
                    ModelState.AddModelError("", "Them Email thanh cong");
                }
            }
            return(View("Index"));
        }
예제 #3
0
        public ActionResult Edit(Email model)
        {
            if (ModelState.IsValid)
            {
                var dao = new emailDao();

                if (!string.IsNullOrEmpty(model.Email1))
                {
                    var result = dao.Update(model);
                    if (result)
                    {
                        return(RedirectToAction("Index", "Email"));
                    }
                    else
                    {
                        ModelState.AddModelError("", "Cap nhap thanh cong");
                    }
                }
            }
            return(View());
        }
예제 #4
0
        public JsonResult Send(string email)
        {
            var feedback = new Email();

            feedback.Email1     = email;
            feedback.CreateDate = DateTime.Now;
            var id = new emailDao().InsertFeddBack(feedback);

            if (id > 0)
            {
                return(Json(new
                {
                    status = true
                }));
            }
            else
            {
                return(Json(new
                {
                    status = false
                }));
            }
        }
예제 #5
0
        public ActionResult Edit(int id)
        {
            var user = new emailDao().ViewDetail(id);

            return(View(user));
        }