예제 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            HistMatch histMatch = await db.HistMatches.FindAsync(id);

            db.HistMatches.Remove(histMatch);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #2
0
        public async Task <ActionResult> Edit([Bind(Include = "id,idUser,idUserMatch,IdEvent,DataCriacao")] HistMatch histMatch)
        {
            if (ModelState.IsValid)
            {
                db.Entry(histMatch).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(histMatch));
        }
예제 #3
0
        public async Task <ActionResult> Create([Bind(Include = "id,idUser,idUserMatch,IdEvent,DataCriacao")] HistMatch histMatch)
        {
            if (ModelState.IsValid)
            {
                db.HistMatches.Add(histMatch);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(histMatch));
        }
예제 #4
0
        // GET: HistMatches/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HistMatch histMatch = await db.HistMatches.FindAsync(id);

            if (histMatch == null)
            {
                return(HttpNotFound());
            }
            return(View(histMatch));
        }