Esempio n. 1
0
        public JsonResult Index(InquirySearchRequest searchRequest)
        {
            string[] userPermissionsSet = (string[])Session["UserPermissionSet"];
            searchRequest.HasPermissionToViewAll = userPermissionsSet.Contains("ViewAllInquiries");
            searchRequest.CurrentUserId          = User.Identity.GetUserId();

            var contactResponse = inquiryService.GetAllInquiries(searchRequest);
            var inquiryList     = contactResponse.Inquiries.ToList().Select(x => x.MapServerToClientSearch()).ToList();
            var model           = new InquiryViewModel()
            {
                data            = inquiryList,
                recordsFiltered = contactResponse.FilteredCount,
                recordsTotal    = contactResponse.TotalCount
            };

            //var obj = new {data = model.EmployeePayrolls, model};
            return(Json(model, JsonRequestBehavior.AllowGet));
        }