Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("id,jobNumber,name,sex,password,idNumber,phone,address,State,birthday")] OperatorEntity operatorEntity)
        {
            if (id != operatorEntity.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(operatorEntity);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OperatorEntityExists(operatorEntity.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(operatorEntity));
        }
Ejemplo n.º 2
0
 public ActionResult UpdateInfo(OperatorEntity operatorEntity)
 {
     _context.Update(operatorEntity);
     _context.SaveChanges();
     return(RedirectToAction(nameof(Index)));
 }