public async Task <ActionResult> DeleteConfirmed(int id)
        {
            SpeciesGroundIndex speciesGroundIndex = await context.SpeciesGroundIndexes.FindAsync(id);

            context.SpeciesGroundIndexes.Remove(speciesGroundIndex);
            await context.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> Edit([Bind(Include = "id,specieId,groundIndexId,value")] SpeciesGroundIndex speciesGroundIndex)
        {
            if (ModelState.IsValid)
            {
                context.Entry(speciesGroundIndex).State = EntityState.Modified;
                await context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.groundIndexId = new SelectList(context.GroundIndexes, "Id", "name", speciesGroundIndex.groundIndexId);
            ViewBag.specieId      = new SelectList(context.Species, "Id", "code", speciesGroundIndex.specieId);
            return(View(speciesGroundIndex));
        }
        // GET: SpeciesGroundIndexes/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SpeciesGroundIndex speciesGroundIndex = await context.SpeciesGroundIndexes.FindAsync(id);

            if (speciesGroundIndex == null)
            {
                return(HttpNotFound());
            }
            return(View(speciesGroundIndex));
        }
        // GET: SpeciesGroundIndexes/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SpeciesGroundIndex speciesGroundIndex = await context.SpeciesGroundIndexes.FindAsync(id);

            if (speciesGroundIndex == null)
            {
                return(HttpNotFound());
            }
            ViewBag.groundIndexId = new SelectList(context.GroundIndexes, "Id", "name", speciesGroundIndex.groundIndexId);
            ViewBag.specieId      = new SelectList(context.Species, "Id", "code", speciesGroundIndex.specieId);
            return(View(speciesGroundIndex));
        }