// GET: Admin/work public ActionResult Index(string Search, int page = 1, int pageSize = 2) { var dao = new workDao(); var model = dao.listAllPaging(Search, page, pageSize); return(View(model)); }
//tao user public ActionResult Create(work acc) { if (ModelState.IsValid) { var dao = new workDao(); int id = dao.Insert(acc); if (id > 0) { return(RedirectToAction("Index", "Work")); } else { ModelState.AddModelError("", "Thêm user thành công"); } } return(View("Index")); }
public ActionResult Edit(updateProject acc) { if (ModelState.IsValid) { var dao = new workDao(); var result = dao.update(acc); if (result) { return(RedirectToAction("Index", "Work")); } else { ModelState.AddModelError("", "Cập nhập thành công"); } } return(View("Index")); }
//view update public ActionResult Edit(int id) { var w = new workDao().viewDetail(id); var updateProject = new updateProject(); updateProject.Id = w.Id; updateProject.nameProject = w.nameProject; updateProject.nameLeader = w.Leader; updateProject.dateWork = w.dateWork; updateProject.dateEnd = w.dateFinsinh; updateProject.numjoin = w.numJoin; var db = new userDao(); var a = db.listAllWithWorkId(id); ViewBag.dsNv = new MultiSelectList(db.listAll(), "ID", "Name", db.listAllWithWorkId(id)); return(View(updateProject)); }
//tao user public ActionResult Create(createProject acc) { if (ModelState.IsValid) { var dao = new workDao(); int id = dao.Insert(acc); if (id > 0) { return(RedirectToAction("Index", "Work")); } else { ModelState.AddModelError("", "Thêm user thành công"); } } if (acc.dsNv == null) { var db = new userDao(); ViewBag.dsNv = new MultiSelectList(db.listAll(), "ID", "Name"); } return(View()); }
//view update public ActionResult Edit(int id) { var user = new workDao().viewDetail(id); return(View(user)); }