예제 #1
0
 public IActionResult Create(Falls fall)
 {
     if (ModelState.IsValid)
     {
         fallsRepository.Add(fall);
         return(RedirectToAction("Index"));
     }
     return(View(fall));
 }
예제 #2
0
        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);
        }
예제 #3
0
 public IActionResult Edit(Falls fall)
 {
     if (ModelState.IsValid)
     {
         fallsRepository.Update(fall);
         return(RedirectToAction("Index", "Falls"));
     }
     else
     {
         return(View(fall));
     }
 }
예제 #4
0
        //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));
        }
예제 #5
0
 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);
 }
예제 #6
0
 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);
 }
예제 #7
0
 public void AddFall(Fall fall)
 {
     Falls.Add(fall);
     CurrentModel.AddFall(fall);
 }