Exemplo n.º 1
0
        public virtual JsonResult DanhSachLoiAjax(JQueryDataTablesModel data)
        {
            List<DanhSachLoi_Result> listerror = _db.DanhSachLoi().ToList();

            var jsonData = new
            {
                data.sEcho,
                iTotalRecords = listerror.Count(),
                iTotalDisplayRecords = listerror.Count(),
                aaData = (
                    listerror.Skip(data.iDisplayStart).Take(data.iDisplayLength).Select(c => new[]
                    {
                        c.ERRORID.ToString(),
                        c.ERRORDESC,
                        c.ERRORLEVEL,
                        c.LEVELDESC,
                        c.ERRORGROUP.ToString(),
                        c.GROUPDESC
                    }).ToArray())
            };
            return Json(jsonData, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 2
0
        public virtual JsonResult DanhSachLoiChiTiet(string pararm, JQueryDataTablesModel data)
        {
            var listerror = new List<DanhSachLoiTheoUserNhap_Result>();

            ObjectResult<DanhSachLoiTheoUserNhap_Result> saa = _db.DanhSachLoiTheoUserNhap(User.Identity.Name);

            switch (pararm)
            {
                case "chuaxl":
                    listerror = saa.Where(c => c.COMPLET.GetValueOrDefault() == false).ToList();
                    break;

                case "all":
                    listerror = saa.ToList();
                    break;
            }

            var jsonData = new
            {
                data.sEcho,
                iTotalRecords = listerror.Count(),
                iTotalDisplayRecords = listerror.Count(),
                aaData = (
                    listerror.Skip(data.iDisplayStart)
                        .Take(data.iDisplayLength)
                        .Select(c => c.ERRORDATE != null
                            ? new[]
                            {
                                c.ERRORDETAILID.ToString(CultureInfo.InvariantCulture),
                                c.SEQ,
                                c.ERRORDESC,
                                c.ERRORTELLER + "-" + c.TenERRORTELLER,
                                c.ERRORTELLERDEPT + "-" + c.TenERRORTELLERDEPT,
                                c.ERRORDATE.Value.ToString("dd/MM/yyyy"),
                                c.COMPLET.GetValueOrDefault().ToString()
                            }
                            : new string[] { })).ToArray()
            };
            return Json(jsonData, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 3
0
 public virtual JsonResult ListError(string sEcho, int iDisplayStart, int iDisplayLength)
 {
     List<listerror_Result> listerror = _db.listerror().ToList();
     int totalcount = listerror.Count();
     var jsonData = new
     {
         sEcho,
         iTotalRecords = totalcount,
         iTotalDisplayRecords = 5,
         aaData = (
             listerror.Select(c => c.ERRORDATE != null
                 ? new[]
                 {
                     c.ERRORDETAILID.ToString(CultureInfo.InvariantCulture),
                     c.SEQ,
                     c.ERRORDESC,
                     c.ERRORTELLER + "-" + c.TenERRORTELLER,
                     c.ERRORTELLERDEPT + "-" + c.TenERRORTELLERDEPT,
                     c.ERRORDATE.Value.ToString("dd/MM/yyyy")
                 }
                 : new string[] { })).ToArray()
     };
     return Json(jsonData, JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 4
0
        public virtual ActionResult DanhSachGdvAjax(JQueryDataTablesModel data)
        {
            var dsgdv = _db.PAR_TELLER.Select(c => c).ToList();

            int totalcount = dsgdv.Count();

            var jsonData = new
            {
                data.sEcho,
                iTotalRecords = totalcount,
                iTotalDisplayRecords = totalcount,
                aaData = (
                    dsgdv.Skip(data.iDisplayStart).Take(data.iDisplayLength)
                        .Select(c => new[] { c.TLCODE, c.TLNAME, c.OFFICER.ToString() })

                        )
            };
            return Json(jsonData, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 5
0
        public virtual JsonResult DanhSachNhomLoiAxAj(JQueryDataTablesModel data)
        {
            List<PAR_ERRORGROUP> listgrouperro = _db.PAR_ERRORGROUP.Select(c => c).ToList();

            var jsonData = new
            {
                data.sEcho,
                iTotalRecords = listgrouperro.Count(),
                iTotalDisplayRecords = listgrouperro.Count(),
                aaData = (
                    listgrouperro.Skip(data.iDisplayStart).Take(data.iDisplayLength).Select(c => new[]
                    {
                        c.GROUPID.ToString(CultureInfo.InvariantCulture),
                        c.GROUPDESC.ToString(CultureInfo.InvariantCulture)
                    }).ToArray())
            };
            return Json(jsonData, JsonRequestBehavior.AllowGet);
        }