Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("HsOwnerId,eMail,Name,WorkOrderId")] HsOwner hsOwner)
        {
            if (id != hsOwner.HsOwnerId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(hsOwner);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HsOwnerExists(hsOwner.HsOwnerId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(hsOwner));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("HsOwnerId,eMail,Name,WorkOrderId")] HsOwner hsOwner)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hsOwner);
                await _context.SaveChangesAsync();

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