public ActionResult List(int page, int rows, string sidx, string sord)
 {
     var contact = new ContactService().List();
     bool searchOn = bool.Parse(Request.Form["_search"]);
     string searchExp = "";
     if (searchOn)
     {
         searchExp = string.Format("{0}.ToString().Contains(@0)", getFormValue("searchField"));
         contact = contact.Where(searchExp, new string[] { getFormValue("searchString") });
     }
     var model = from entity in contact.OrderBy(sidx + " " + sord)
                 select new
                 {
                     Id = entity.Id,
                     Name = entity.Name,
                     Email = entity.Email,
                     Department = entity.Department!=null?entity.Department.Name:string.Empty,
                     Status = entity.Status
                 };
     return Json(model.ToJqGridData(page, rows, null, "", new[] { "Name", "Email", "Status" }), JsonRequestBehavior.AllowGet);
 }
        public ActionResult Pdf()
        {
            var data = new ContactService().GetAllItems();

            return new BinaryContentResult(CreatePdf(data), "application/pdf");
        }