public string guardarEditar() { string respuesta = ""; try { using (var context = new ModelGps()) { if (this.idobservacion == 0) { context.Entry(this).State = EntityState.Added; respuesta = "ingresado"; } else { context.Entry(this).State = EntityState.Modified; respuesta = "modificado"; } context.SaveChanges(); } } catch (Exception e) { throw; } return(respuesta); }
public void guardarEditar() { try { using (var context = new ModelGps()) { if (this.idcliente == 0) { context.Entry(this).State = EntityState.Added; } else { context.Entry(this).State = EntityState.Modified; } context.SaveChanges(); } } catch (Exception) { throw; } }
public void eliminarVehiculo() { try { using (var context = new ModelGps()) { context.Entry(this).State = EntityState.Deleted; context.SaveChanges(); } } catch (Exception) { throw; } }
public void eliminarChip() { try { using (var context = new ModelGps()) { context.Entry(this).State = EntityState.Deleted; context.SaveChanges(); } } catch (Exception e) { throw new Exception(e.Message); } }