예제 #1
0
        // 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));
        }
예제 #2
0
 //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"));
 }
예제 #3
0
        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"));
        }
예제 #4
0
        //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));
        }
예제 #5
0
 //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());
 }
예제 #6
0
        //view update
        public ActionResult Edit(int id)
        {
            var user = new workDao().viewDetail(id);

            return(View(user));
        }