public ActionResult List(int?id) { identity = ((CustomPrincipal)User).CustomIdentity; var model = new DqQueListModel(); model.MdmList.Add(new SelectListItem { Value = "1", Text = "Individual Customer" }); model.MdmList.Add(new SelectListItem { Value = "2", Text = "Corporate Customer", Selected = true }); model.MdmList.Add(new SelectListItem { Value = "0", Text = "All", Selected = true }); model.MDM_ID = id == null ? 0 : Convert.ToInt32(id); _messagingService.SaveUserActivity(identity.ProfileId, "Viewed Data Quality Queue", DateTime.Now); return(View(model)); }
public virtual ActionResult List(DataSourceRequest command, DqQueListModel model, string sort, string sortDir) { var routeValues = System.Web.HttpContext.Current.Request.RequestContext.RouteData.Values; //RouteValueDictionary routeValues; int?mdmId = 0; if (routeValues.ContainsKey("id")) { mdmId = int.Parse((string)routeValues["id"]); } else { mdmId = model.MDM_ID; } var items = _dqQueService.GetAllQueItems(model.SearchName, mdmId, command.Page - 1, command.PageSize, string.Format("{0} {1}", sort, sortDir)); //var logItems = _logger.GetAllLogs(createdOnFromValue, createdToFromValue, model.Message, // logLevel, command.Page - 1, command.PageSize); DateTime _today = DateTime.Now.Date; var gridModel = new DataSourceResult { Data = items.Select(x => new DqQueListModel { RECORD_ID = x.RECORD_ID, DATA_SOURCE = x.DATA_SOURCE, CATALOG_NAME = x.CATALOG_NAME, DQ_PROCESS_NAME = x.DQ_PROCESS_NAME, ERROR_DESC = x.ERROR_DESC, DaysonQue = Math.Round((_today - x.CREATED_DATE).Value.TotalDays) + " days", PCT_COMPLETION = x.PCT_COMPLETION, PRIORITY = x.PRIORITY, ISSUE_PRIORITY_DESC = x.MdmDQPriorities.PRIORITY_DESCRIPTION, CATALOG_ID = x.CATALOG_ID, CREATED_DATE = x.CREATED_DATE// _dateTimeHelper.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc) }), Total = items.TotalCount }; //var gridModel = new DataSourceResult //{ // Data = items.Select(x => // { // var itemsModel = x.ToModel(); // PrepareSomethingModel(itemsModel, x, false, false); // return itemsModel; // }), // Total = items.TotalCount, //}; return(Json(gridModel)); }