Exemplo n.º 1
0
 public bool Edit(BeTipoContrabando item)
 {
     try
     {
         using (var db = new EstG2Contex())
         {
             var tn = new TipoContrabando();
             tn.UsuarioActualizo = "MJimenez";
             tn.FechaActualizo   = DateTime.Now;
             tn.Nombre           = item.Nombre;
             tn.ContrabandoID    = item.ContrabandoID;
             tn.EstatusID        = item.EstatusID;
             db.TipoContrabando.Attach(tn);
             db.Entry(tn).Property(x => x.Nombre).IsModified           = true;
             db.Entry(tn).Property(x => x.EstatusID).IsModified        = true;
             db.Entry(tn).Property(x => x.UsuarioActualizo).IsModified = true;
             db.Entry(tn).Property(x => x.FechaActualizo).IsModified   = true;
             db.SaveChanges();
             return(true);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemplo n.º 2
0
 public bool Edit(BeTipoContrabando item)
 {
     try
     {
         return(_dalc.Edit(item));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemplo n.º 3
0
 public ActionResult Edit(BeTipoContrabando item)
 {
     if (item == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     try
     {
         _BcTipoContrabando.Edit(item);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemplo n.º 4
0
 public bool Create(BeTipoContrabando item)
 {
     try
     {
         using (var db = new EstG2Contex())
         {
             var tn = new TipoContrabando();
             tn.Nombre        = item.Nombre;
             tn.EstatusID     = (int)item.EstatusID;
             tn.UsuarioCreo   = "MJimenez";
             tn.TipoNovedadID = 9;
             tn.FechaCreo     = DateTime.Now;
             db.TipoContrabando.Add(tn);
             db.SaveChanges();
             return(true);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemplo n.º 5
0
 public ActionResult Create(BeTipoContrabando item)
 {
     try
     {
         if (item == null)
         {
             AllEstados();
             return(View(item));
         }
         try
         {
             _BcTipoContrabando.Create(item);
             return(RedirectToAction("Index"));
         }
         catch (Exception ex)
         {
             throw new Exception(ex.Message);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }