示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,NomArl,TelArl")] Arl arl)
        {
            if (id != arl.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(arl);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ArlExists(arl.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(arl));
        }
        public async Task <ActionResult <Arl> > PostArl(Arl arl)
        {
            _context.Arl.Add(arl);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetArl", new { id = arl.ArlCodigo }, arl));
        }
        public async Task <IActionResult> PutArl(int id, Arl arl)
        {
            if (id != arl.ArlCodigo)
            {
                return(BadRequest());
            }

            _context.Entry(arl).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ArlExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Arl arl = db.Tb_Arl.Find(id);

            db.Tb_Arl.Remove(arl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Arl_Id,Arl_Nom,Arl_Registro")] Arl arl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(arl).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(arl));
 }
示例#6
0
        public async Task <IActionResult> Create([Bind("Id,NomArl,TelArl")] Arl arl)
        {
            if (ModelState.IsValid)
            {
                _context.Add(arl);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(arl));
        }
        public ActionResult Create([Bind(Include = "Arl_Id,Arl_Nom,Arl_Registro")] Arl arl)
        {
            if (ModelState.IsValid)
            {
                db.Tb_Arl.Add(arl);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(arl));
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Arl arl = db.Tb_Arl.Find(id);

            if (arl == null)
            {
                return(HttpNotFound());
            }
            return(View(arl));
        }