public async Task <IActionResult> PutShootingLocation(int id, ShootingLocation shootingLocation)
        {
            if (id != shootingLocation.Id)
            {
                return(BadRequest());
            }

            _context.Entry(shootingLocation).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ShootingLocationExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <ActionResult <ShootingLocation> > PostShootingLocation(ShootingLocation shootingLocation)
        {
            _context.ShootingLocation.Add(shootingLocation);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetShootingLocation", new { id = shootingLocation.Id }, shootingLocation));
        }
        public ActionResult Edit([Bind(Include = "Id,Name,State,Location,Notes")] ShootingLocation modEntity)
        {
            if (ModelState.IsValid)
            {
                this.service.Edit(modEntity);
                return(RedirectToAction("Index"));
            }

            ViewBag.State = new SelectList(State.GetStates(), "Abbreviation", "Abbreviation", modEntity.State);
            return(View(modEntity));
        }
Ejemplo n.º 4
0
 internal static E_DBReturnCode ReadShootingLocationByName(string name, out ShootingLocation foundShootingLocation, out string errorMessage)
 {
     return(PersistenceManager.ReadShootingLocationByName(name, out foundShootingLocation, out errorMessage));
 }
Ejemplo n.º 5
0
 internal static LocationListerDisplayItem ConvertToListerDisplayItem(LocationDisplayItem locationDisplayItem, ShootingLocation shootingLocation)
 {
     return(new LocationListerDisplayItem()
     {
         CountryName = locationDisplayItem.CountryName,
         AreaName = locationDisplayItem.AreaName,
         SubAreaName = locationDisplayItem.SubAreaName,
         SubjectLocationName = locationDisplayItem.SubjectLocationName,
         SubjectLocationLatitude = locationDisplayItem.SubjectLocationLatitude,
         SubjectLocationLongitude = locationDisplayItem.ShootingLocationLongitude,
         ShootingLocationName = locationDisplayItem.ShootingLocationName,
         ShootingLocationLatitude = locationDisplayItem.ShootingLocationLatitude,
         ShootingLocationLongitude = locationDisplayItem.ShootingLocationLongitude,
         Photo_1 = locationDisplayItem.Photo_1,
         Photo_2 = locationDisplayItem.Photo_2,
         Photo_3 = locationDisplayItem.Photo_3,
         ParkingLocationName = locationDisplayItem.ParkingLocationName,
         ParkingLocationLatitude = locationDisplayItem.ParkingLocationLatitude,
         ParkingLocationLongitude = locationDisplayItem.ParkingLocationLongitude,
         Tag = shootingLocation
     });
 }