public IActionResult Details(int id, string sortOrder)
        {
            ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            ViewBag.TypeSortParm = sortOrder == "type" ? "type_desc" : "type";
            if (HttpContext.Session.Get("Username") != null)
            {
                userID = Convert.ToInt32(HttpContext.Session.GetInt32("UserID"));
                try
                {
                    List list = collectionRepository.GetList(id, userID);
                    switch (sortOrder)
                    {
                    case "name_desc":
                        list.items = list.items.OrderByDescending(s => s.Title).ThenByDescending(s => s.ItemType);
                        break;

                    case "type":
                        list.items = list.items.OrderBy(s => s.ItemType).ThenBy(s => s.Title);
                        break;

                    case "type_desc":
                        list.items = list.items.OrderByDescending(s => s.ItemType).ThenByDescending(s => s.Title);
                        break;

                    default:
                        list.items = list.items.OrderBy(s => s.Title).ThenBy(s => s.ItemType);
                        break;
                    }
                    return(View(list));
                }
                catch (Exception e)
                {
                    string message = e.Message;
                    return(View("Error", "Database"));
                }
            }
            return(RedirectToAction("Login", "User"));
        }