예제 #1
0
        public async Task <IActionResult> Create([Bind("PkIxMaterielsTypes,MaterielType")] IxMaterielsTypes ixMaterielsTypes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ixMaterielsTypes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ixMaterielsTypes));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,Name,NormalizedName,ConcurrencyStamp")] AspNetRoles aspNetRoles)
        {
            if (ModelState.IsValid)
            {
                _context.Add(aspNetRoles);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(aspNetRoles));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("Id,UserName,NormalizedUserName,Email,NormalizedEmail,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnd,LockoutEnabled,AccessFailedCount")] AspNetUsers aspNetUsers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(aspNetUsers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(aspNetUsers));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("PkAntenne,Ville,CodePostal,Tel,Adresse")] IxAntenne ixAntenne)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ixAntenne);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ixAntenne));
        }
예제 #5
0
        public async Task <IActionResult> Create([Bind("PkMateriels,FkMaterielsTypes,Identifiant,DateAchat")] Materiels materiels)
        {
            if (ModelState.IsValid)
            {
                _context.Add(materiels);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FkMaterielsTypes"] = new SelectList(_context.IxMaterielsTypes, "PkIxMaterielsTypes", "PkIxMaterielsTypes", materiels.FkMaterielsTypes);
            return(View(materiels));
        }
예제 #6
0
        public async Task <IActionResult> Create([Bind("Pk,UserId,RoleId")] AspNetUserRoles aspNetUserRoles)
        {
            if (ModelState.IsValid)
            {
                _context.Add(aspNetUserRoles);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RoleId"] = new SelectList(_context.AspNetRoles, "Id", "Id", aspNetUserRoles.RoleId);
            ViewData["UserId"] = new SelectList(_context.AspNetUsers, "Id", "Id", aspNetUserRoles.UserId);
            return(View(aspNetUserRoles));
        }
예제 #7
0
        public async Task <IActionResult> Create([Bind("Pk,FkMateriels,FkMaterielsStatuts,FkIxAntenne,FkAspNetUsers,DateDebut,DateFin,Commentaire")] LinksMaterielsIxMaterielStatuts linksMaterielsIxMaterielStatuts)
        {
            if (ModelState.IsValid)
            {
                _context.Add(linksMaterielsIxMaterielStatuts);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                var errors = ModelState.Select(x => x.Value.Errors)
                             .Where(y => y.Count > 0)
                             .ToList();
            }
            ViewData["FkAspNetUsers"]      = new SelectList(_context.AspNetUsers, "Id", "UserName");
            ViewData["FkIxAntenne"]        = new SelectList(_context.IxAntenne, "PkAntenne", "Ville");
            ViewData["FkMateriels"]        = new SelectList(_context.Materiels, "PkMateriels", "Identifiant");
            ViewData["FkMaterielsStatuts"] = new SelectList(_context.IxMaterielsStatuts, "PkIxMaterielsStatuts", "MaterielStatut");
            return(View(linksMaterielsIxMaterielStatuts));
        }