Exemple #1
0
        public ActionResult DanhSachNhanVien()
        {
            var ds = tkb.LayDSTaiKhoan();

            ViewBag.UserName = new SelectList(ds, "UserName", "UserName");
            return(View());
        }
        public JsonResult LoadData(int page, int pagesize, string searchName)
        {
            var ds = db.LayDSTaiKhoan();

            int totalrow = ds.Count();
            int sl       = totalrow;
            var model    = ds.Skip((page - 1) * pagesize).Take(pagesize);

            if (!string.IsNullOrEmpty(searchName))
            {
                model    = ds.FindAll(x => x.UserName.ToLower().Contains(searchName));
                totalrow = model.Count();
            }
            return(Json(new { data = model, total = totalrow, sl = sl }, JsonRequestBehavior.AllowGet));
        }