Пример #1
0
        public async Task <ActionResult> Edit([Bind(Include = "TipoBienID,TipoBienDescripcion")] TipoBien tipobien)
        {
            if (ModelState.IsValid)
            {
                db.Entry(tipobien).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(tipobien));
        }
Пример #2
0
        public async Task <ActionResult> Create([Bind(Include = "TipoBienID,TipoBienDescripcion")] TipoBien tipobien)
        {
            if (ModelState.IsValid)
            {
                db.TipoBiens.Add(tipobien);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(tipobien));
        }
Пример #3
0
 public void Update(TipoBienDTO entity)
 {
     try
     {
         TipoBien tipoBien = Mapper.Map <TipoBien>(entity);
         tipoBienService.Update(tipoBien);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #4
0
        // GET: /TipoBien/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TipoBien tipobien = await db.TipoBiens.FindAsync(id);

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