コード例 #1
0
        public async Task <IActionResult> RegistrarLuchador([Bind("Nombre", "Apellidos", "Categoria", "Diciplina", "Descripcion1", "Descripcion2", "Descripcion3")] Luchador luchador)
        {
            if (ModelState.IsValid)
            {
                _context.Add(luchador);
                await _context.SaveChangesAsync();

                return(RedirectToAction("VerLuchadores"));
            }
            return(View(luchador));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("Nombre", "Apellidos", "Usu", "Contraseña", "ConfirmarContraseña", "Correo", "ConfirmarCorreo", "Celular", "Nacimiento")] Usuario usuario)
        {
            if (ModelState.IsValid)
            {
                _context.Add(usuario);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Login"));
            }
            return(View(usuario));
        }
コード例 #3
0
        public async Task <IActionResult> CrearEmpresa([Bind("Gerente", "RUC", "Nombre", "Direccion", "Celular", "Telefono", "Tipo")] Empresa empresa)
        {
            if (ModelState.IsValid)
            {
                _context.Add(empresa);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Empresas"));
            }
            return(View(empresa));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("ID,Name,Password,Account")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
コード例 #5
0
        public async Task <IActionResult> Create([Bind("Id,Title,Content")] Article article)
        {
            if (ModelState.IsValid)
            {
                _context.Add(article);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(article));
        }
コード例 #6
0
        public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,Email,Message")] UserInfo userInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(userInfo));
        }
コード例 #7
0
        public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,PhoneNumber,Email,BirthDate")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
コード例 #8
0
        public async Task <IActionResult> RegistrarFactura([Bind("CodigoFactura", "PlacaTracto", "PlacaCarreta", "CodigoConductor", "Origen", "FechaSalida", "Destino", "FechaDestino", "CodigoCarga", "FechaEntregaDocumento", "MontoFacturado", "Estado", "FechaCobrado", "MontoCobrado")] Factura factura)
        {
            if (ModelState.IsValid)
            {
                _context.Add(factura);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Facturas"));
            }
            return(View(factura));
        }
コード例 #9
0
        public async Task <IActionResult> Create([Bind("Id,name,description")] 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("ID,Nombre,Precio,Stock")] Producto producto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(producto);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(producto));
        }
コード例 #11
0
        public async Task <IActionResult> Agregar_juegos([Bind("Nom_juego, Desc_juego, trailer_juego, Img_juego, pre_juego")] Juegos juegos)
        {
            if (ModelState.IsValid)
            {
                _context.Add(juegos);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Mostrar_juegos)));
            }
            return(View(juegos));
        }
コード例 #12
0
        public async Task <IActionResult> Create([Bind("Nombre")] Cita cita)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cita);
                await _context.SaveChangesAsync();

                return(RedirectToAction("index"));
            }
            return(View("Cita", cita));
        }
コード例 #13
0
        public async Task <IActionResult> Create([Bind("Id,name,picture_url")] Category category)
        {
            if (ModelState.IsValid)
            {
                _context.Add(category);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }
コード例 #14
0
        public async Task <IActionResult> Agregar_Programas([Bind("Nom_programa, Desc_programa, Img_programa, pre_programa")] Programas programas)
        {
            if (ModelState.IsValid)
            {
                _context.Add(programas);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Mostrar_Programas)));
            }
            return(View(programas));
        }
コード例 #15
0
        public async Task <IActionResult> Create([Bind("ID,Nombre,Precio,Celular,Email,Mensaje")] Servicio servicio)
        {
            if (ModelState.IsValid)
            {
                _context.Add(servicio);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(servicio));
        }
コード例 #16
0
        public async Task <IActionResult> Create([Bind("Id,Title,ReleaseDate,Price,Genre,Rating")] Movie movie)
        {
            if (ModelState.IsValid)
            {
                _context.Add(movie);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(movie));
        }
コード例 #17
0
        public async Task <IActionResult> Create([Bind("Id,Title,ReleaseDate,Rating,Author")] Book book)
        {
            if (ModelState.IsValid)
            {
                _context.Add(book);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(book));
        }
コード例 #18
0
        public async Task <IActionResult> Agregar_Perifericos([Bind("Nom_perifericos, Desc_perifericos, Img_perifericos, pre_perifericos")] Perifericos perifericos)
        {
            if (ModelState.IsValid)
            {
                _context.Add(perifericos);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Mostrar_Perifericos)));
            }
            return(View(perifericos));
        }
コード例 #19
0
        public async Task <IActionResult> Create([Bind("ID,Name,IdentityCard,WebPage,Address,Phone,Sector")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
コード例 #20
0
        public async Task <IActionResult> Create([Bind("Nom_juego, Desc_juego, Trailer_juego, Imagen_juego, Pre_juego")] Prueba_bd prueba_bd)
        {
            if (ModelState.IsValid)
            {
                _context.Add(prueba_bd);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Prueba)));
            }
            return(View(prueba_bd));
        }
コード例 #21
0
        public async Task <IActionResult> Create([Bind("Nombre,Mascota,Telefono,TipoTelefono,Doctor,Fecha,Hora,TipoMascota,TipoCita,Direccion")] Cita cita)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cita);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index", "Home"));
            }
            return(View("Cita", cita));
        }
コード例 #22
0
        public async Task <IActionResult> Create([Bind("Name")] Student student)
        {
            if (ModelState.IsValid)
            {
                _context.Add(student);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(student));
        }
コード例 #23
0
        public async Task <IActionResult> Create([Bind("Id,name,description,price,added_date,BrandId")] Item item)
        {
            if (ModelState.IsValid)
            {
                _context.Add(item);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BrandId"] = new SelectList(_context.Brands, "Id", "Id", item.BrandId);
            return(View(item));
        }
コード例 #24
0
        public async Task <IActionResult> Create([Bind("ID,ClientID,Name,LastName,Email,Phone,Employment")] Contact contact)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contact);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientID"] = new SelectList(_context.Client, "ID", "IdentityCard", contact.ClientID);
            return(View(contact));
        }
コード例 #25
0
        public async Task <IActionResult> Create([Bind("Id,name,CountryId")] Brand brand)
        {
            if (ModelState.IsValid)
            {
                _context.Add(brand);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "Id", brand.CountryId);
            return(View(brand));
        }
コード例 #26
0
        public async Task <IActionResult> Create([Bind("Id,UserId,RoleId")] User_Role user_Role)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user_Role);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RoleId"] = new SelectList(_context.Roles, "Id", "Id", user_Role.RoleId);
            ViewData["UserId"] = new SelectList(_context.Users, "Id", "Id", user_Role.UserId);
            return(View(user_Role));
        }
コード例 #27
0
        public async Task <IActionResult> Create([Bind("ID,ProblemTittle,ProblemDetail,UserID,ClientID,Status")] SupportTicket supportTicket)
        {
            if (ModelState.IsValid)
            {
                _context.Add(supportTicket);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientID"] = new SelectList(_context.Client, "ID", "IdentityCard", supportTicket.ClientID);
            ViewData["UserID"]   = new SelectList(_context.User, "ID", "Name", supportTicket.UserID);
            return(View(supportTicket));
        }
コード例 #28
0
        public async Task <IActionResult> Create([Bind("ID,MeetingTittle,Date,UserID,Virtual,ClientID")] Meeting meeting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(meeting);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientID"] = new SelectList(_context.Client, "ID", "IdentityCard", meeting.ClientID);
            ViewData["UserID"]   = new SelectList(_context.User, "ID", "Name", meeting.UserID);
            return(View(meeting));
        }