// GET: Admin/Email public ActionResult Index() { var dao = new emailDao(); var model = dao.ListAllPaging(); return(View(model)); }
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")); }
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()); }
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 })); } }
public ActionResult Edit(int id) { var user = new emailDao().ViewDetail(id); return(View(user)); }