Esempio n. 1
0
        public JsonResult LoadData(int page, int pageSize)
        {
            IQueryable <CaLamViec> lstCaLamViec = bll.LayTatCa() as IQueryable <CaLamViec>;

            int totalRow = lstCaLamViec.Count();
            List <CaLamViecModel> lst = new List <CaLamViecModel>();

            foreach (var item in lstCaLamViec)
            {
                CaLamViecModel ca = new CaLamViecModel()
                {
                    MaCaLamViec  = item.MaCaLamViec,
                    TenCaLamViec = item.TenCaLamViec,
                    ThoiGianVao  = item.ThoiGianVao.ToString(),
                    ThoiGianRa   = item.ThoiGianRa.ToString(),
                    GhiChu       = item.GhiChu
                };
                lst.Add(ca);
            }
            return(Json(new
            {
                data = lst.Skip((page - 1) * pageSize).Take(pageSize),
                total = totalRow,
                status = true
            }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public JsonResult GetDetail(string id)
        {
            CaLamViec      caLamViec = bll.TimKiemTheoMa(id);
            CaLamViecModel ca        = new CaLamViecModel()
            {
                MaCaLamViec  = caLamViec.MaCaLamViec,
                TenCaLamViec = caLamViec.TenCaLamViec,
                ThoiGianVao  = caLamViec.ThoiGianVao.ToString(),
                ThoiGianRa   = caLamViec.ThoiGianRa.ToString(),
                GhiChu       = caLamViec.GhiChu
            };

            return(Json(new
            {
                data = ca,
                status = true
            }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
        public JsonResult Search(int page, int pageSize, string information)
        {
            IQueryable <CaLamViec> lstCaLamViec = null;

            if (string.IsNullOrEmpty(information))
            {
                lstCaLamViec = bll.LayTatCa() as IQueryable <CaLamViec>;
                //lstNhanVien = db.NhanViens as IQueryable<NhanVien>;
            }
            else
            {
                lstCaLamViec = bll.TimKiemGanDungTheoTen(information) as IQueryable <CaLamViec>;
                //lstNhanVien = db.NhanViens.Where(x => x.TenNhanVien.Contains(information)) as IQueryable<NhanVien>;
            }


            int totalRow = lstCaLamViec.Count();
            List <CaLamViecModel> lst = new List <CaLamViecModel>();

            foreach (var item in lstCaLamViec)
            {
                CaLamViecModel ca = new CaLamViecModel()
                {
                    MaCaLamViec  = item.MaCaLamViec,
                    TenCaLamViec = item.TenCaLamViec,
                    ThoiGianVao  = item.ThoiGianVao.ToString(),
                    ThoiGianRa   = item.ThoiGianRa.ToString(),
                    GhiChu       = item.GhiChu
                };
                lst.Add(ca);
            }
            return(Json(new
            {
                data = lst.Skip((page - 1) * pageSize).Take(pageSize),
                total = totalRow,
                status = true
            }, JsonRequestBehavior.AllowGet));
        }