Ejemplo n.º 1
0
        public JsonResult GetData()
        {
            var page     = int.Parse(this.Request.QueryString.Get("page") ?? "1");
            var pagesize = int.Parse(this.Request.QueryString.Get("rows") ?? "20");
            var content  = this.Request.QueryString.Get("jobcontent");
            var total    = 0;
            var data     = workmeetingbll.GetBaseDataNew(content, pagesize, page, out total);

            foreach (JobTemplateEntity j in data)
            {
                if (j.Usetime == 0 || j.EditTime == 0)
                {
                    j.Percent = 0;
                }
                else
                {
                    j.Percent = Math.Round(Convert.ToDecimal(j.EditTime) / j.Usetime, 2);
                }
            }
            return(Json(new { rows = data, records = total, page = page, total = Math.Ceiling((decimal)total / pagesize) }, JsonRequestBehavior.AllowGet));
        }