Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,JobbookCompanyName,JobbookCompanyDescription,JobbookCompanyWebsite,JobbookCompanyEmail,JobbookCompanyTel")] JobbookCompanyModel jobbookCompanyModel)
        {
            if (id != jobbookCompanyModel.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(jobbookCompanyModel);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!JobbookCompanyModelExists(jobbookCompanyModel.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(jobbookCompanyModel));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ID,JobbookCompanyName,JobbookCompanyDescription,JobbookCompanyWebsite,JobbookCompanyEmail,JobbookCompanyTel")] JobbookCompanyModel jobbookCompanyModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobbookCompanyModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(jobbookCompanyModel));
        }