public async Task <IActionResult> Create([Bind("Id,Name,Email,Vetran")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,Experience")] Developer developer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(developer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(developer));
        }
        public async Task <IActionResult> Create([Bind("Id,ProjectTitle,Details,Budget,ClientId")] Project project)
        {
            if (ModelState.IsValid)
            {
                _context.Add(project);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientId"] = new SelectList(_context.Client, "Id", "Id", project.ClientId);
            return(View(project));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("Id,BidValue,ProjectId,DeveloperId")] Bid bid)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bid);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DeveloperId"] = new SelectList(_context.Set <Developer>(), "Id", "Id", bid.DeveloperId);
            ViewData["ProjectId"]   = new SelectList(_context.Set <Project>(), "Id", "Id", bid.ProjectId);
            return(View(bid));
        }