private List <AdminFoundAlert> FormatQueryResults(List <Tuple <PetAlertTableModel, PetTableModel, OwnerTableModel, PetImageTableModel> > queryResults) { var foundAlerts = new List <AdminFoundAlert>(); AdminFoundAlert adminFoundAlert; foreach (var item in queryResults) { adminFoundAlert = new AdminFoundAlert { Id = item.Item1.Id, Code = item.Item1.Code, OwnerFullName = $"{item.Item3.FirstName} {item.Item3.LastName}", OwnerProfileImageUrl = item.Item3.ProfileImageUrl, PetName = item.Item2.Name, PetProfileImageUrl = item.Item4.ImageUrl, FoundComment = item.Item1.CommentFound, FoundDateTime = item.Item1.SolvedOn.Value }; foundAlerts.Add(adminFoundAlert); } return(foundAlerts); }
public CommentToApproveViewModel AdminFoundAlertToViewModel(AdminFoundAlert adminFoundAlert) { return(new CommentToApproveViewModel { Id = adminFoundAlert.Id, Code = adminFoundAlert.Code.ToString(), OwnerName = HttpUtility.HtmlDecode(adminFoundAlert.OwnerFullName), ownerProfileImageUrl = adminFoundAlert.OwnerProfileImageUrl, PetName = HttpUtility.HtmlDecode(adminFoundAlert.PetName), PetProfileImageUrl = adminFoundAlert.PetProfileImageUrl, FoundComment = HttpUtility.HtmlDecode(adminFoundAlert.FoundComment), FoundDateTime = adminFoundAlert.FoundDateTime.ToString("dd/MMM/yyyy hh:mm:ss tt") }); }