Example #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Password")] Admin admin)
        {
            if (ModelState.IsValid)
            {
                _context.Add(admin);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(admin));
        }
 public async Task<IActionResult> Create([Bind("Id,Website")] ContactDetails contactDetails)
 {
     if (ModelState.IsValid)
     {
         _context.Add(contactDetails);
         await _context.SaveChangesAsync();
         return RedirectToAction(nameof(Index));
     }
     ViewData["Id"] = new SelectList(_context.Emails, "Id", "Email", contactDetails.Id);
     return View(contactDetails);
 }
        public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,Gender")] TeamLeaders teamLeaders)
        {
            if (ModelState.IsValid)
            {
                _context.Add(teamLeaders);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(teamLeaders));
        }
Example #4
0
        public async Task <IActionResult> Create([Bind("Id,Name")] Category category)
        {
            if (ModelState.IsValid)
            {
                _context.Add(category);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }
Example #5
0
        public async Task <IActionResult> Create([Bind("Id,Lat,Long,AddressDetails")] Address address)
        {
            if (ModelState.IsValid)
            {
                _context.Add(address);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(address));
        }
Example #6
0
        public async Task <IActionResult> Create([Bind("Id,Type,Email,IdcontactDetails")] Emails emails)
        {
            if (ModelState.IsValid)
            {
                _context.Add(emails);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(emails));
        }
        public async Task <IActionResult> Create([Bind("Id,PhoneNumber,IdcontactDetails")] PhoneNumbers phoneNumbers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(phoneNumbers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdcontactDetails"] = new SelectList(_context.ContactDetails, "Id", "Id", phoneNumbers.IdcontactDetails);
            return(View(phoneNumbers));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,Path,IdroboticEntity")] Photos photos)
        {
            if (ModelState.IsValid)
            {
                _context.Add(photos);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdroboticEntity"] = new SelectList(_context.RoboticEntity, "Id", "Name", photos.IdroboticEntity);
            return(View(photos));
        }
        public async Task <IActionResult> Create([Bind("Id,Network,Address,IdcontactDetails")] Social social)
        {
            if (ModelState.IsValid)
            {
                _context.Add(social);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdcontactDetails"] = new SelectList(_context.ContactDetails, "Id", "Id", social.IdcontactDetails);
            return(View(social));
        }
Example #10
0
        public async Task <IActionResult> Create([Bind("Id,Name,Description,IdteamLeader")] Projects projects)
        {
            if (ModelState.IsValid)
            {
                _context.Add(projects);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdteamLeader"] = new SelectList(_context.TeamLeaders, "Id", "FirstName", projects.IdteamLeader);
            return(View(projects));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,Idaddress,Idcategory,Description,MemberCount,Rating,IdcontactDetails,WomenPercentage,Sentiment")] RoboticEntity roboticEntity)
        {
            if (ModelState.IsValid)
            {
                _context.Add(roboticEntity);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Idaddress"]        = new SelectList(_context.Address, "Id", "AddressDetails", roboticEntity.Idaddress);
            ViewData["Idcategory"]       = new SelectList(_context.Category, "Id", "Name", roboticEntity.Idcategory);
            ViewData["IdcontactDetails"] = new SelectList(_context.ContactDetails, "Id", "Id", roboticEntity.IdcontactDetails);
            return(View(roboticEntity));
        }