コード例 #1
0
    public static bool deleteUser(int idUser)
    {
        bool            result = true;
        storedProcedure sp     = new storedProcedure("ConnectionString");

        result = sp.ejecutaSQL("delete usuarioRol where idUsuario =" + idUser + "");
        result = sp.ejecutaSQL("delete becasAlumnos where idAlumno = " + idUser + "");
        result = sp.ejecutaSQL("delete alumno where idAlumno = " + idUser + "");
        return(result);
    }
コード例 #2
0
    public static string eliminarS(int idB)
    {
        storedProcedure sp = new storedProcedure("ConnectionString");

        sp.ejecutaSQL("delete becasAlumnos where  idBecasAlumnos = " + idB + " ");

        return("0");
    }
コード例 #3
0
    public static string solicitarB(int iduser, int idBeca)
    {
        storedProcedure sp = new storedProcedure("ConnectionString");

        sp.ejecutaSQL("insert into becasAlumnos values(" + iduser + "," + idBeca + ")");

        return("0");
    }
コード例 #4
0
    public static string modificar(int id, string beca, int tipob, float prom, int ido, string desc)
    {
        storedProcedure sp = new storedProcedure("ConnectionString");

        if (ido == 1)
        {
            sp.ejecutaSQL("update beca set nombreBeca ='" + beca + "' , promedio=" + prom + " ,idTipoBeca = " + tipob + " where idBeca =" + id + " ");
        }
        else if (ido == 2)
        {
            sp.ejecutaSQL("update grupo set grupo = '" + beca + "', descripcion = '" + desc + "' where idgrupo = " + id + " ");
        }
        else if (ido == 3)
        {
            sp.ejecutaSQL("update carrera set carrera ='" + beca + "' , descripcion = '" + desc + "' where idCarrera = " + id + " ");
        }
        else if (ido == 4)
        {
            sp.ejecutaSQL("update tipoBeca set tipoBeca ='" + beca + "' , descripcion=  '" + desc + "' where idTipoBeca =  " + id + " ");
        }

        return("0");
    }
コード例 #5
0
    public static string guardar(string beca, int tipob, float prom, int ido, string desc)
    {
        storedProcedure sp = new storedProcedure("ConnectionString");

        if (ido == 1)
        {
            string q = "insert into beca values(" + beca + "," + prom + "," + tipob + "";
            sp.ejecutaSQL("insert into beca values('" + beca + "'," + prom + "," + tipob + ")");
        }
        else if (ido == 2)
        {
            sp.ejecutaSQL("insert into grupo values ('" + beca + "','" + desc + "')");
        }
        else if (ido == 3)
        {
            sp.ejecutaSQL("insert into carrera values ('" + beca + "','" + desc + "')");
        }
        else if (ido == 4)
        {
            sp.ejecutaSQL("insert into tipoBeca values ('" + beca + "','" + desc + "')");
        }

        return("0");
    }
コード例 #6
0
    public static string eliminar(int origen, int id)
    {
        storedProcedure sp = new storedProcedure("ConnectionString");

        try {
            if (origen == 1)
            {
                sp.ejecutaSQL("delete alumno where idbeca = " + id + "");
                sp.ejecutaSQL("delete beca where idbeca = " + id + "");
            }
            else if (origen == 2)
            {
                var re = "delete alumno where idgrupo = " + id + "";
                var ri = "delete grupo where idrupo = " + id + "";
                sp.ejecutaSQL("delete alumno where idgrupo = " + id + "");
                sp.ejecutaSQL("delete grupo where idgrupo = " + id + "");
            }
            else if (origen == 3)
            {
                var re = "delete alumno where idCarrera = " + id + "";
                var ri = "delete carrera where idCarrera = " + id + "";

                sp.ejecutaSQL("delete alumno where idCarrera = " + id + "");
                sp.ejecutaSQL("delete carrera where idCarrera = " + id + "");
            }
            else if (origen == 4)
            {
                var re = "delete alumno where idCarrera = " + id + "";
                var ri = "delete carrera where idCarrera = " + id + "";

                sp.ejecutaSQL("delete tipoBeca where idTipoBeca = " + id + "");
            }

            return("0");
        }catch (Exception ex) {
            return("-1");
        }
    }