Beispiel #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Path")] EmoPicture emoPicture)
        {
            if (ModelState.IsValid)
            {
                _context.Add(emoPicture);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(emoPicture));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,EmoPictureId,X,Y,Width,Height")] EmoFace emoFace)
        {
            if (ModelState.IsValid)
            {
                _context.Add(emoFace);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmoPictureId"] = new SelectList(_context.EmoPictures, "Id", "Id", emoFace.EmoPictureId);
            return(View(emoFace));
        }
Beispiel #3
0
        public async Task <IActionResult> Create([Bind("Id,Score,EmoFaceId,EmotionType")] EmoEmotion emoEmotion)
        {
            if (ModelState.IsValid)
            {
                _context.Add(emoEmotion);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmoFaceId"] = new SelectList(_context.EmoFaces, "Id", "Id", emoEmotion.EmoFaceId);
            return(View(emoEmotion));
        }