Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }