Exemplo n.º 1
0
        public static bool Eliminar(int id)
        {
            try
            {
                using (var db = new SistemaVentasDb())
                {
                    TipoUsuarios t = new TipoUsuarios();
                    t = db.TipoUsuarios.Find(id);

                    db.TipoUsuarios.Remove(t);
                    db.SaveChanges();
                    db.Dispose();
                    return(false);
                }
            }
            catch (Exception)
            {
                return(true);

                throw;
            }
        }
        public static bool Eliminar(int id)
        {
            try
            {
                using (var db = new SistemaVentasDb())
                {
                    CondicionPagos cps = new CondicionPagos();
                    cps = db.CodicionPagos.Find(id);

                    db.CodicionPagos.Remove(cps);
                    db.SaveChanges();
                    db.Dispose();
                    return(false);
                }
            }
            catch (Exception)
            {
                return(true);

                throw;
            }
        }
Exemplo n.º 3
0
        public static bool Eliminar(int id)
        {
            //bool retorna = false;
            try
            {
                using (var db = new SistemaVentasDb())
                {
                    Usuarios us = new Usuarios();
                    us = db.Usuarios.Find(id);

                    db.Usuarios.Remove(us);
                    db.SaveChanges();
                    db.Dispose();
                    return(false);
                }
            }
            catch (Exception)
            {
                return(true);

                throw;
            }
        }
Exemplo n.º 4
0
        public static bool Insertar(Empleados e)
        {
            //bool retorna = false;

            try
            {
                using (var db = new SistemaVentasDb())
                {
                    db.Empleados.Add(e);
                    db.SaveChanges();
                    db.Dispose();
                    //retorna = true;
                    return(true);
                }
            }
            catch (Exception)
            {
                return(false);

                throw;
            }
            // return   retorna;
        }