public async Task <IActionResult> Create([Bind("ProfId,Lastname,Firstname,Profession,Birthdate,Address,City,Region,Postalcode,DestinationId,Phone,Mail,Minavailability,Maxavailability")] Professionist professionist)
        {
            if (ModelState.IsValid)
            {
                _context.Add(professionist);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DestinationId"] = new SelectList(_context.Destinations, "DestinationId", "Name", professionist.DestinationId);
            return(View(professionist));
        }
        public async Task <IActionResult> Create([Bind("SkillId,GeneralareaId,ProfId,Level,Description")] Skill skill)
        {
            if (ModelState.IsValid)
            {
                _context.Add(skill);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GeneralareaId"] = new SelectList(_context.GeneralArea, "GeneralareaId", "Name", skill.GeneralareaId);
            ViewData["ProfId"]        = new SelectList(_context.Professionists, "ProfId", "Lastname" + "Firstname", skill.ProfId);
            return(View(skill));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("CompId,Name,Type,Address,City,Region,Postalcode,DestinationId,GeneralareaId,Mission")] Company companies)
        {
            if (ModelState.IsValid)
            {
                _context.Add(companies);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DestinationId"] = new SelectList(_context.Destinations, "DestinationId", "Name", companies.DestinationId);
            ViewData["GeneralareaId"] = new SelectList(_context.GeneralArea, "GeneralareaId", "Name", companies.GeneralareaId);
            return(View(companies));
        }
        public async Task <IActionResult> Create([Bind("ReqId,CompId,ProjId,SkillId,DestinationId,BeginningDate,EndingDate,Description")] Request request)
        {
            if (ModelState.IsValid)
            {
                _context.Add(request);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CompId"]        = new SelectList(_context.Companies, "CompId", "Address", request.CompId);
            ViewData["DestinationId"] = new SelectList(_context.Destinations, "DestinationId", "Name", request.DestinationId);
            ViewData["ProjId"]        = new SelectList(_context.Projects, "ProjId", "Description", request.ProjId);
            ViewData["SkillId"]       = new SelectList(_context.Skills, "SkillId", "Description", request.SkillId);
            return(View(request));
        }