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;
     }
 }
Ejemplo n.º 4
0
 public static void Guardar(Empleados em)
 {
     try
     {
         Parcial2Db db = new Parcial2Db();
         db.empleado.Add(em);
         db.SaveChanges();
         db.Dispose();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }