public void Dispose() { if (context != null) { context.Dispose(); } }
public static void Insertar(PresupuestoDetalle pd) { try { Parcial2Db db = new Parcial2Db(); db.detalle.Add(pd); db.SaveChanges(); db.Dispose(); } catch (Exception ex) { throw ex; } }
public static void Guardar(TiposEmails em) { try { Parcial2Db db = new Parcial2Db(); db.Tipos.Add(em); db.SaveChanges(); db.Dispose(); } catch (Exception ex) { throw ex; } }
public static void Guardar(Empleados em) { try { Parcial2Db db = new Parcial2Db(); db.empleado.Add(em); db.SaveChanges(); db.Dispose(); } catch (Exception ex) { throw ex; } }
public static bool Insertar(Clientes c) { bool retorno = false; try { var db = new Parcial2Db(); db.Clientes.Add(c); db.SaveChanges(); db.Dispose(); retorno = true; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } return(retorno); }
public static bool Insertar(TiposTelefonos t) { bool retorno = false; try { var db = new Parcial2Db(); db.TiposTelefono.Add(t); db.SaveChanges(); db.Dispose(); retorno = true; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } return(retorno); }