public IActionResult Create(Falls fall) { if (ModelState.IsValid) { fallsRepository.Add(fall); return(RedirectToAction("Index")); } return(View(fall)); }
public void AddFall(Fall fall) { if (fall.FallId == -1 || fall.FallLocation == null || fall.FallTime.AddMinutes(10) > DateTime.Now) { return; } Falls.Add(fall); // CurrentModel.AddFall(fall); }
public IActionResult Edit(Falls fall) { if (ModelState.IsValid) { fallsRepository.Update(fall); return(RedirectToAction("Index", "Falls")); } else { return(View(fall)); } }
//GET: /Falls/Edit/1 public IActionResult Edit(int?id) { if (id == null) { return(NotFound()); } Falls fall = fallsRepository.FindByID(id.Value); if (fall == null) { return(NotFound()); } return(View(fall)); }
public void Update(Falls item) { Connection.Execute("UPDATE upfall SET name = @name, datum = @datum, zone = @zone, northing = @northing, easting = @easting, lat_lon = @lat_lon, county_id = @county_id, open_to_public = @open_to_public, owner_id = @owner_id, description = @description, confirmed_date = @confirmed_date WHERE id = @id", item); }
public void Add(Falls item) { Connection.Execute("INSERT INTO upfall (id, name, open_to_public, description, confirmed_date) VALUES (@Name, @Open_To_Public, @Description, @Confirmed_Date)", item); }
public void AddFall(Fall fall) { Falls.Add(fall); CurrentModel.AddFall(fall); }