示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("GlobalScoreEntryId,DateCreated,DateModified,GlobalScoreType,TimeFrameTotal,WeekEnding")] GlobalScoreEntry globalScoreEntry)
        {
            if (id != globalScoreEntry.GlobalScoreEntryId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(globalScoreEntry);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GlobalScoreEntryExists(globalScoreEntry.GlobalScoreEntryId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(globalScoreEntry));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("GlobalScoreEntryId,DateCreated,DateModified,GlobalScoreType,TimeFrameTotal,WeekEnding")] GlobalScoreEntry globalScoreEntry)
        {
            if (ModelState.IsValid)
            {
                _context.Add(globalScoreEntry);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(globalScoreEntry));
        }