public CARGO traeCargo(int id) { CARGO cargo = new CARGO(); try { using (var context = new SIGHUContext()) { cargo = (from c in context.CARGO where c.IdCargo == id select c).FirstOrDefault(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(cargo); }
public void activaCargo(int id) { CARGO cargo = new CARGO(); try { using (var context = new SIGHUContext()) { cargo = (from c in context.CARGO where c.IdCargo == id select c).FirstOrDefault(); cargo.Activo = 1; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }