示例#1
0
        public async Task <IActionResult> Create([Bind("Detail,Timestamp,WebinarMeetingId,ParticipantId,Id,Modified")] Post post)
        {
            if (ModelState.IsValid)
            {
                _context.Add(post);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(post));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("Id,Value")] Configuration configuration)
        {
            if (ModelState.IsValid)
            {
                _context.Add(configuration);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(configuration));
        }
示例#3
0
        public async Task <IActionResult> Create([Bind("Name,Origin,JoinDate,RegisterId,Id,Modified")] Participant participant)
        {
            if (ModelState.IsValid)
            {
                _context.Add(participant);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(participant));
        }
        public async Task <IActionResult> Create([Bind("AñoDeCreacion,Pais,Ciudad,Dirección,TipoEscuela,Id,Nombre")] Escuela escuela)
        {
            if (ModelState.IsValid)
            {
                _context.Add(escuela);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(escuela));
        }
示例#5
0
        public async Task <IActionResult> Create([Bind("PasswordHash,Username,LastLogin,Active,Id,Modified")] Login login)
        {
            if (ModelState.IsValid)
            {
                _context.Add(login);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(login));
        }
示例#6
0
        public async Task <IActionResult> Create([Bind("RoleId,UserId,Id,Modified")] UserRoleMapping userRoleMapping)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userRoleMapping);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(userRoleMapping));
        }
示例#7
0
        public async Task <IActionResult> Create([Bind("Name,Id")] Language language)
        {
            if (ModelState.IsValid)
            {
                _context.Add(language);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(language));
        }
示例#8
0
        public async Task <IActionResult> Create([Bind("Name,UtcOffset,Dst,Id,Modified")] MTimeZone mTimeZone)
        {
            if (ModelState.IsValid)
            {
                _context.Add(mTimeZone);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(mTimeZone));
        }
示例#9
0
        public async Task <IActionResult> Create([Bind("Id,Modified")] Role role)
        {
            if (ModelState.IsValid)
            {
                _context.Add(role);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(role));
        }
示例#10
0
        public async Task <IActionResult> Create([Bind("Event,Timestamp,Description,WebinarMeetingId,Id,Modified")] InteractionLog interactionLog)
        {
            if (ModelState.IsValid)
            {
                _context.Add(interactionLog);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(interactionLog));
        }
示例#11
0
        public async Task <IActionResult> Create([Bind("Name,EmailAddress,Subject,Message,Accepted,WebinarMeetingId,Id,Modified")] Invitation invitation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(invitation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(invitation));
        }
示例#12
0
        public async Task <IActionResult> Create([Bind("Date,ParticipantId,WebinarMeetingId,Id,Modified")] Register register)
        {
            if (ModelState.IsValid)
            {
                _context.Add(register);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(register));
        }
示例#13
0
        public async Task <IActionResult> Create([Bind("EscuelaId,AñoCreación,TipoEscuela,CantAlumnos,Direccion,UniqueId,Nombre")] Escuela escuelaModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(escuelaModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(escuelaModel));
        }
        public async Task <IActionResult> Create([Bind("Nombre,Jornada,Direccion,EscuelaId,Id,Descripicion")] Curso curso)
        {
            if (ModelState.IsValid)
            {
                _context.Add(curso);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EscuelaId"] = new SelectList(_context.Escuelas, "Id", "Id", curso.EscuelaId);
            return(View(curso));
        }
示例#15
0
        public async Task <IActionResult> Create([Bind("Username,FirstName,LastName,DateOfBirth,CompanyName,PhoneNumber,LanguageId,PhotoUrl,Id,Modified")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LanguageId"] = new SelectList(_context.Language, "Id", "Id", user.LanguageId);
            return(View(user));
        }
        public async Task <IActionResult> Create([Bind("Nombre,CursoId,Descripicion,Id")] Asignatura asignatura)
        {
            if (ModelState.IsValid)
            {
                _context.Add(asignatura);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CursoId"] = new SelectList(_context.Cursos, "Id", "Id", asignatura.CursoId);
            return(View(asignatura));
        }
示例#17
0
        public async Task <IActionResult> Create([Bind("Name,Data,WebinarMeetingId,ExpireDate,Id,Modified")] MediaRecord mediaRecord)
        {
            if (ModelState.IsValid)
            {
                _context.Add(mediaRecord);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["WebinarMeetingId"] = new SelectList(_context.WebinarMeeting, "Id", "Description", mediaRecord.WebinarMeetingId);
            return(View(mediaRecord));
        }
        public async Task <IActionResult> Create([Bind("CursoId,Id,Nombre")] Alumno alumno)
        {
            if (ModelState.IsValid)
            {
                _context.Add(alumno);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CursoId"] = new SelectList(_context.Cursos, "Id", "Id", alumno.CursoId);
            return(View(alumno));
        }
示例#19
0
        public async Task <IActionResult> Create([Bind("AsignaturaId,CursoId,UniqueId,Nombre")] Asignatura asignaturaModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(asignaturaModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CursoId"] = new SelectList(_context.Cursos, "CursoId", "CursoId", asignaturaModel.CursoId);
            return(View(asignaturaModel));
        }
示例#20
0
        public async Task <IActionResult> Create([Bind("StartDate,Duration,Password,HostVideoEnabled,ParticipantVideoEnabled,MaxParticipants,Description,Name,BannerUrl,UserId,Price,Id,Modified")] WebinarMeeting webinarMeeting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(webinarMeeting);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserId"] = new SelectList(_context.User, "Id", "FirstName", webinarMeeting.UserId);
            return(View(webinarMeeting));
        }
示例#21
0
        public async Task <IActionResult> Create([Bind("Nombre,EscuelaId,TipoCurso,Direccion,Id")] Curso curso)
        {
            if (ModelState.IsValid)
            {
                curso.Id = Guid.NewGuid();
                _context.Add(curso);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EscuelaId"] = new SelectList(_context.Escuelas, "Id", "Nombre", curso.EscuelaId);
            return(View(curso));
        }
示例#22
0
        public async Task <IActionResult> Create([Bind("AlumnoId,AsignaturaId,Nota,Id,Nombre")] Evaluación evaluación)
        {
            if (ModelState.IsValid)
            {
                _context.Add(evaluación);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AlumnoId"]     = new SelectList(_context.Alumnos, "Id", "Nombre", evaluación.AlumnoId);
            ViewData["AsignaturaId"] = new SelectList(_context.Asignaturas, "Id", "Nombre", evaluación.AsignaturaId);
            return(View(evaluación));
        }
        public async Task <IActionResult> Create([Bind("Nombre,CursoId")] Asignatura asignatura)
        {
            if (ModelState.IsValid)
            {
                asignatura.Id = Guid.NewGuid().ToString();
                _context.Add(asignatura);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CursoId"] = new SelectList(_context.Cursos.OrderByDescending(c => c.Nombre), "Id", "Nombre", asignatura.CursoId);
            return(View(asignatura));
        }
        public IActionResult Create(Curso curso)
        {
            if (ModelState.IsValid)
            {
                var escuela = _context.Escuelas.FirstOrDefault();
                curso.EscuelaId = escuela.Id;

                _context.Add(curso);
                _context.SaveChanges();

                ViewBag.Mensaje = "Curso creado correctamente!!";
                return(View("Index", curso));
            }
            else
            {
                return(View(curso));
            }
        }