コード例 #1
0
ファイル: AdminController.cs プロジェクト: Soja1923/CarRent
 public IActionResult LocationIndex(int locationId)
 {
     return(View(
                repo.GetAll()
                .Include(a => a.Address)
                .FirstOrDefault(l => l.Location_ID == locationId)));
 }
コード例 #2
0
        // GET: Map
        public ActionResult Index()
        {
            //List<LocationViewModel> lvm = repo.GetAll();
            //foreach (var item in lvm)
            //{
            //    string base64String = Convert.ToBase64String(item.Picture, 0, item.Picture.Length);
            //    item.Picture
            //    Image1.ImageUrl = "data:image/png;base64," + base64String;
            //}

            if (Request.Cookies["OwnerId"] != null)
            {
                ViewBag.UserId = Request.Cookies["OwnerId"].Value;
            }



            return(View(repo.GetAll()));
        }
コード例 #3
0
        List <SelectListItem> SelectListItemsLocation(EditCarDetalisView vm)
        {
            var locationList         = repoLocation.GetAll().Include(l => l.Address).Distinct().ToList();
            var locationListSelected = new List <SelectListItem>();

            foreach (var item in locationList)
            {
                string addresText = item.Address.ToString();
                string id         = item.Location_ID.ToString();
                locationListSelected.Add(new SelectListItem {
                    Text = addresText, Value = id
                });
            }
            return(locationListSelected);
        }
コード例 #4
0
 public ViewResult LocationList()
 => View(
     repo.GetAll()
     .OrderBy(l => l.Location_ID)
     .Include(a => a.Address));