コード例 #1
0
        public int Guardar()
        {
            int intDesarrollador = (Desarrollador) ? 1 : 0;

            if (Id != 0)
            {
                if (!ClsBaseDatos.BDBool("Update Grupo Set Nombre = '" + Nombre + "', Version = " + ClsFunciones.DoubleToString(Version) + ", Fecha = '" + ClsFunciones.FechaMySQL(Fecha) + "', Organizacion = '" + Organizacion + "', Rol = '" + Rol + "', Desarrollador = " + intDesarrollador + ", Categoria = " + Categoria + ", Comentario = '" + Comentario + "' where Id = " + Id + ";"))
                {
                    return(-1);
                }
            }
            else
            if (!ClsBaseDatos.BDBool("Insert into Grupo(Nombre,Version,Fecha,Organizacion,Rol,Desarrollador,Categoria,Comentario) values ('" + Nombre + "'," + ClsFunciones.DoubleToString(Version) + ",'" + ClsFunciones.FechaMySQL(Fecha) + "','" + Organizacion + "','" + Rol + "'," + intDesarrollador + "," + Categoria + ",'" + Comentario + "');"))
            {
                return(-2);
            }
            return(0);
        }
コード例 #2
0
        public int Guardar()
        {
            int intEstado = (Estado) ? 1 : 0;

            if (Id != 0)
            {
                if (!ClsBaseDatos.BDBool("Update ReqInfo Set Nombre = '" + Nombre + "', Version = " + ClsFunciones.DoubleToString(Version) + ", Fecha = '" + ClsFunciones.FechaMySQL(Fecha) + "', Descripcion = '" + Descripcion + "', TiemMed = " + TiempoMedio + ", TiemMax = " + TiempoMaximo + ", OcuMed = " + OcurreMedio + ", OcuMax = " + OcurreMaximo + ", Prioridad = " + Prioridad + ", Urgencia = " + Urgencia + ", Estabilidad = " + Estabilidad + ", Estado = " + intEstado + ", Categoria = " + Categoria + ", Comentario = '" + Comentario + "' where Id = " + Id + ";"))
                {
                    return(-1);
                }
                ClsBaseDatos.BDBool("Delete from ReqIAuto where IdReq = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ReqIFuen where IdReq = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ReqIObj where IdReq = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ReqIReqR where IdReq = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ReqIDatEsp where IdReq = " + Id + ";");
                if (GuardarTablas(Id) == -1)
                {
                    return(-1);
                }
            }
            else
            {
                if (!ClsBaseDatos.BDBool("Insert into ReqInfo(Nombre,Version,Fecha,Descripcion,TiemMed,TiemMax,OcuMed,OcuMax,Prioridad,Urgencia,Estabilidad,Estado,Categoria,Comentario) values ('" + Nombre + "'," + ClsFunciones.DoubleToString(Version) + ",'" + ClsFunciones.FechaMySQL(Fecha) + "','" + Descripcion + "'," + TiempoMedio + "," + TiempoMaximo + "," + OcurreMedio + "," + OcurreMaximo + "," + Prioridad + "," + Urgencia + "," + Estabilidad + "," + intEstado + "," + Categoria + ",'" + Comentario + "');"))
                {
                    return(-2);
                }
                if (GuardarTablas((int)ClsBaseDatos.BDDouble("Select Id from ReqInfo order by Id Desc;")) == -1)
                {
                    return(-2);
                }
            }
            return(0);
        }
コード例 #3
0
 public int Guardar()
 {
     if (Id != 0)
     {
         if (!ClsBaseDatos.BDBool("Update Actores Set Nombre = '" + Nombre + "', Version = " + ClsFunciones.DoubleToString(Version) + ", Fecha = '" + ClsFunciones.FechaMySQL(Fecha) + "', Descripcion = '" + Descripcion + "', Complejidad = " + Complejidad + ", DescComple = '" + DescComplejidad + "', Categoria = " + Categoria + ", Comentario = '" + Comentario + "' where Id = " + Id + ";"))
         {
             return(-1);
         }
         ClsBaseDatos.BDBool("Delete from ActAuto where IdAct = " + Id + ";");
         ClsBaseDatos.BDBool("Delete from ActFuen where IdAct = " + Id + ";");
         if (GuardarTablas(Id) == -1)
         {
             return(-1);
         }
     }
     else
     {
         if (!ClsBaseDatos.BDBool("Insert into Actores(Nombre,Version,Fecha,Descripcion,Complejidad,DescComple,Categoria,Comentario) values ('" + Nombre + "'," + ClsFunciones.DoubleToString(Version) + ",'" + ClsFunciones.FechaMySQL(Fecha) + "','" + Descripcion + "'," + Complejidad + ",'" + DescComplejidad + "'," + Categoria + ",'" + Comentario + "');"))
         {
             return(-2);
         }
         if (GuardarTablas((int)ClsBaseDatos.BDDouble("Select Id from Actores order by Id Desc;")) == -1)
         {
             return(-2);
         }
     }
     return(0);
 }
コード例 #4
0
        public int Guardar()
        {
            int intEstado = (Estado) ? 1 : 0, intPaquete = (int)ClsBaseDatos.BDDouble("Select Id from Paquetes where Nombre = '" + Paquete + "';");

            if (Id != 0)
            {
                if (!ClsBaseDatos.BDBool("Update ReqFun Set Nombre = '" + Nombre + "',Version = " + ClsFunciones.DoubleToString(Version) + ", Fecha = '" + ClsFunciones.FechaMySQL(Fecha) + "', Descripcion = '" + Descripcion + "', Paquete = " + intPaquete + ", PreCond = '" + Precondicion + "', PostCond = '" + Postcondicion + "', Complejidad = " + Complejidad + ", Prioridad = " + Prioridad + ", Urgencia = " + Urgencia + ", Estabilidad = " + Estabilidad + ", Estado = " + intEstado + ", Categoria = " + Categoria + ", Comentario = '" + Comentario + "' where Id = " + Id + ";"))
                {
                    return(-1);
                }
                ClsBaseDatos.BDBool("Delete from ReqAct where IdReq = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ReqAuto where IdReq = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ReqFuen where IdReq = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ReqObj where IdReq = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ReqReqR where IdReq = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ReqSecNor where IdReq = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ReqSecExc where IdReq = " + Id + ";");
                if (GuardarTablas(Id) == -1)
                {
                    return(-1);
                }
            }
            else
            {
                if (!ClsBaseDatos.BDBool("Insert into ReqFun(Nombre,Version,Fecha,Descripcion,Paquete,Precond,Postcond,Complejidad,Prioridad,Urgencia,Estabilidad,Estado,Categoria,Comentario) values ('" + Nombre + "'," + ClsFunciones.DoubleToString(Version) + ",'" + ClsFunciones.FechaMySQL(Fecha) + "','" + Descripcion + "'," + intPaquete + ",'" + Precondicion + "','" + Postcondicion + "'," + Complejidad + "," + Prioridad + "," + Urgencia + "," + Estabilidad + "," + intEstado + "," + Categoria + ",'" + Comentario + "');"))
                {
                    return(-2);
                }
                if (GuardarTablas((int)ClsBaseDatos.BDDouble("Select Id from ReqFun order by Id Desc;")) == -1)
                {
                    return(-2);
                }
            }
            return(0);
        }
コード例 #5
0
        public int Guardar()
        {
            int intEstado = (Estado) ? 1 : 0;

            if (Id != 0)
            {
                if (!ClsBaseDatos.BDBool("Update Objetivos Set Nombre = '" + Nombre + "', Version = " + ClsFunciones.DoubleToString(Version) + ", Fecha = '" + ClsFunciones.FechaMySQL(Fecha) + "', Descripcion = '" + Descripcion + "', Prioridad = " + Prioridad + ", Urgencia = " + Urgencia + ", Estabilidad = " + Estabilidad + ", Estado = " + intEstado + ", Categoria = " + Categoria + ", Comentario = '" + Comentario + "' where Id = " + Id + ";"))
                {
                    return(-1);
                }
                ClsBaseDatos.BDBool("Delete from ObjAuto where IdObj = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ObjFuen where IdObj = " + Id + ";");
                ClsBaseDatos.BDBool("Delete from ObjSubobj where IdObj = " + Id + ";");
                if (GuardarTablas(Id) == -1)
                {
                    return(-1);
                }
            }
            else
            {
                if (!ClsBaseDatos.BDBool("Insert into Objetivos(Nombre,Version,Fecha,Descripcion,Prioridad,Urgencia,Estabilidad,Estado,Categoria,Comentario) values ('" + Nombre + "'," + ClsFunciones.DoubleToString(Version) + ",'" + ClsFunciones.FechaMySQL(Fecha) + "','" + Descripcion + "'," + Prioridad + "," + Urgencia + "," + Estabilidad + "," + intEstado + "," + Categoria + ",'" + Comentario + "');"))
                {
                    return(-2);
                }
                if (GuardarTablas((int)ClsBaseDatos.BDDouble("Select Id from Objetivos order by Id Desc;")) == -1)
                {
                    return(-2);
                }
            }
            return(0);
        }
コード例 #6
0
        private int Exportar()
        {
            try
            {
                StreamWriter sw    = new StreamWriter(LblRutaBD.Content + "\\" + TxtNomBD.Text + ".RR");
                DataTable    tabla = new DataTable();
                DataRow      fila;
                PBProg1.Maximum = 28; PBProg1.Value = 0;

                sw.WriteLine(ClsConf.Encriptar("Delete from ReqNReqR;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqNObj;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqNFuen;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqNAuto;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqIDatEsp;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqIReqR;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqIObj;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqIFuen;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqIAuto;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqSecExc;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqSecNor;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqAct;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqReqR;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqObj;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqFuen;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqAuto;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ObjSubobj;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ObjFuen;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ObjAuto;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ActFuen;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ActAuto;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqNFunc;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqFun;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from ReqInfo;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from Objetivos;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from Actores;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from Paquetes;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from Grupo;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from Estim;"));
                sw.WriteLine(ClsConf.Encriptar("Delete from Paquetes where Id = 1;"));

                //Generales
                tabla           = ClsBaseDatos.BDTable("select * From Grupo");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into Grupo values(" + fila[0].ToString() + ",'" + fila[1].ToString() + "'," + ClsFunciones.DoubleToString((double)fila[2]) + ",'" + ClsFunciones.FechaMySQL((DateTime)fila[3]) + "','" + fila[4].ToString() + "','" + fila[5].ToString() + "'," + fila[6].ToString() + "," + fila[7].ToString() + ",'" + fila[8].ToString() + "');")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From Paquetes");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into Paquetes values (" + fila[0].ToString() + ",'" + fila[1].ToString() + "'," + ClsFunciones.DoubleToString((double)fila[2]) + ",'" + ClsFunciones.FechaMySQL((DateTime)fila[3]) + "'," + fila[4].ToString() + ",'" + fila[5].ToString() + "');")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From Actores");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into Actores values (" + fila[0].ToString() + ",'" + fila[1].ToString() + "'," + ClsFunciones.DoubleToString((double)fila[2]) + ",'" + ClsFunciones.FechaMySQL((DateTime)fila[3]) + "','" + fila[4].ToString() + "'," + fila[5].ToString() + ",'" + fila[6].ToString() + "'," + fila[7].ToString() + ",'" + fila[8].ToString() + "');")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From Objetivos");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into Objetivos values (" + fila[0].ToString() + ",'" + fila[1].ToString() + "'," + ClsFunciones.DoubleToString((double)fila[2]) + ",'" + ClsFunciones.FechaMySQL((DateTime)fila[3]) + "','" + fila[4].ToString() + "'," + fila[5].ToString() + "," + fila[6].ToString() + "," + fila[7].ToString() + "," + fila[8].ToString() + "," + fila[9].ToString() + ",'" + fila[10].ToString() + "');")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqInfo");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqInfo values (" + fila[0].ToString() + ",'" + fila[1].ToString() + "'," + ClsFunciones.DoubleToString((double)fila[2]) + ",'" + ClsFunciones.FechaMySQL((DateTime)fila[3]) + "','" + fila[4].ToString() + "'," + fila[5].ToString() + "," + fila[6].ToString() + "," + fila[7].ToString() + "," + fila[8].ToString() + "," + fila[9].ToString() + "," + fila[10].ToString() + "," + fila[11].ToString() + "," + fila[12].ToString() + "," + fila[13].ToString() + ",'" + fila[14].ToString() + "');")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqFun");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqFun values (" + fila[0].ToString() + ",'" + fila[1].ToString() + "'," + ClsFunciones.DoubleToString((double)fila[2]) + ",'" + ClsFunciones.FechaMySQL((DateTime)fila[3]) + "','" + fila[4].ToString() + "'," + fila[5].ToString() + ",'" + fila[6].ToString() + "','" + fila[7].ToString() + "'," + fila[8].ToString() + "," + fila[9].ToString() + "," + fila[10].ToString() + "," + fila[11].ToString() + "," + fila[12].ToString() + "," + fila[13].ToString() + ",'" + fila[14].ToString() + "');")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqNFunc");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqNFunc values (" + fila[0].ToString() + ",'" + fila[1].ToString() + "'," + ClsFunciones.DoubleToString((double)fila[2]) + ",'" + ClsFunciones.FechaMySQL((DateTime)fila[3]) + "','" + fila[4].ToString() + "'," + fila[5].ToString() + "," + fila[6].ToString() + "," + fila[7].ToString() + "," + fila[8].ToString() + "," + fila[9].ToString() + ",'" + fila[10].ToString() + "');")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                //Actores
                tabla           = ClsBaseDatos.BDTable("select * From ActAuto");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ActAuto values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ActFuen");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ActFuen values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                //Objetivos
                tabla           = ClsBaseDatos.BDTable("select * From ObjAuto");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ObjAuto values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ObjFuen");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ObjFuen values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ObjSubobj");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ObjSubobj values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                //Requisitos funcionales
                tabla           = ClsBaseDatos.BDTable("select * From ReqAuto");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqAuto values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqFuen");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqFuen values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqObj");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqObj values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqReqR");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqReqR values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + "," + fila[3].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqAct");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqAct values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqSecNor");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqSecNor values (" + fila[0].ToString() + "," + fila[1].ToString() + ",'" + fila[2].ToString() + "');")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqSecExc");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqSecExc values (" + fila[0].ToString() + "," + fila[1].ToString() + ",'" + fila[2].ToString() + "');")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                //Requisitos de informacion
                tabla           = ClsBaseDatos.BDTable("select * From ReqIAuto");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqIAuto values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqIFuen");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqIFuen values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqIObj");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqIObj values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqIReqR");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqIReqR values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + "," + fila[3].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqIDatEsp");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqIDatEsp values (" + fila[0].ToString() + "," + fila[1].ToString() + ",'" + fila[2].ToString() + "');")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                //Requisitos no funcionales
                tabla           = ClsBaseDatos.BDTable("select * From ReqNAuto");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqNAuto values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqNFuen");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqNFuen values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqNObj");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqNObj values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                tabla           = ClsBaseDatos.BDTable("select * From ReqNReqR");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into ReqNReqR values (" + fila[0].ToString() + "," + fila[1].ToString() + "," + fila[2].ToString() + "," + fila[3].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();

                //Estimaciones
                tabla           = ClsBaseDatos.BDTable("select * From Estim");
                PBProg2.Maximum = tabla.Rows.Count - 1;
                for (int i = 0; (i <= tabla.Rows.Count - 1); i++)
                {
                    fila = tabla.Rows[i];
                    sw.WriteLine(ClsConf.Encriptar("Insert into Estim values ('" + fila[0].ToString() + "'," + fila[1].ToString() + ");")); PBProg2.Value = i; DoEvents();
                }
                PBProg1.Value++; DoEvents();
                sw.Close();
                return(0);
            }
            catch
            {
                return(-1);
            }
        }
コード例 #7
0
        public int CrearBase()
        {
            if (TipoBD.Equals(DefValues.MySql))
            {
                ConexionMySql();
                if (!ClsBaseDatos.BDConexion(BuilderMySql.ToString(), TipoBD))
                {
                    return(-1);
                }
                if (CreateMySql)
                {
                    ClsBaseDatos.BDBool("CREATE SCHEMA " + BDMySql, BuilderMySql.ToString(), TipoBD);
                    BuilderMySql.Database = BDMySql;
                }
                ClsBaseDatos.BDBool("CREATE TABLE `Actores` (`Id` int not null auto_increment, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Descripcion` text(500) not null, `Complejidad` int not null, `DescComple` varchar(100) not null, `Categoria` int not null, `Comentario` Text(500) not null, primary key(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `Grupo` (`Id` int not null auto_increment, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Organizacion` varchar(100) not null, `Rol` varchar(100) not null, `Desarrollador` int not null, `Categoria` int not null, `Comentario` Text(500) not null, primary key(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `Objetivos` (`Id` int not null auto_increment, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Descripcion` varchar(100) not null, `Prioridad` int not null, `Urgencia` int not null, `Estabilidad` int not null, `Estado` int not null, `Categoria` int not null, `Comentario` Text(500) not null, primary key(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `Paquetes` (`Id` int not null auto_increment, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Categoria` int not null, `Comentario` Text(500) not null, primary key(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqFun` (`Id` int not null auto_increment, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Descripcion` varchar(100) not null, `Paquete` int not null, `Precond` varchar(100) not null, `Postcond` varchar(100) not null, `Complejidad` int not null, `Prioridad` int not null, `Urgencia` int not null, `Estabilidad` int not null, `Estado` int not null, `Categoria` int not null, `Comentario` Text(500) not null, primary key(`Id`), foreign key(`Paquete`) references `Paquetes`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqInfo` (`Id` int not null auto_increment, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Descripcion` varchar(100) not null, `TiemMed` int not null, `TiemMax` int not null, `OcuMed` int not null, `OcuMax` int not null, `Prioridad` int not null, `Urgencia` int not null, `Estabilidad` int not null, `Estado` int not null, `Categoria` int not null, `Comentario` Text(500) not null, primary key(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqNFunc` (`Id` int not null auto_increment, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Descripcion` varchar(100) not null, `Prioridad` int not null, `Urgencia` int not null, `Estabilidad` int not null, `Estado` int not null, `Categoria` int not null, `Comentario` Text(500) not null, primary key(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `Estim` (`NomEst` VARCHAR(10) NOT NULL, `ValEst` INT NOT NULL,  PRIMARY KEY(`NomEst`));", BuilderMySql.ToString(), TipoBD);

                ClsBaseDatos.BDBool("CREATE TABLE `ActAuto` (`Id` int not null auto_increment, `IdAutor` int not null, `IdAct` int not null, primary key(`Id`), foreign key(`IdAutor`) references `Grupo`(`Id`), foreign key(`IdAct`) references `Actores`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ActFuen` (`Id` int not null auto_increment, `IdFuen` int not null, `IdAct` int not null, primary key(`Id`), foreign key(`IdFuen`) references `Grupo`(`Id`), foreign key(`IdAct`) references `Actores`(`Id`));", BuilderMySql.ToString(), TipoBD);

                ClsBaseDatos.BDBool("CREATE TABLE `ObjAuto` (`Id` int not null auto_increment, `IdAutor` int not null, `IdObj` int not null, primary key(`Id`), foreign key(`IdAutor`) references `Grupo`(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ObjFuen` (`Id` int not null auto_increment, `IdFuen` int not null, `IdObj` int not null, primary key(`Id`), foreign key(`IdFuen`) references `Grupo`(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ObjSubobj` (`Id` int not null auto_increment, `IdSubobj` int not null, `IdObj` int not null, primary key(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`));", BuilderMySql.ToString(), TipoBD);

                ClsBaseDatos.BDBool("CREATE TABLE `ReqAct` (`Id` int not null auto_increment, `IdAct` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdAct`) references `Actores`(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqAuto` (`Id` int not null auto_increment, `IdAutor` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdAutor`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqFuen` (`Id` int not null auto_increment, `IdFuen` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdFuen`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqObj` (`Id` int not null auto_increment, `IdObj` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqReqR` (`Id` int not null auto_increment, `IdReqR` int not null, `TipoReq` int not null, `IdReq` int not null, primary key(`Id`),  foreign key(`IdReq`) references `ReqFun`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqSecExc` (`Id` int not null auto_increment, `IdReq` int not null, `Descrip` varchar(100) not null, primary key(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqSecNor` (`Id` int not null auto_increment, `IdReq` int not null, `Descrip` varchar(100) not null, primary key(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", BuilderMySql.ToString(), TipoBD);

                ClsBaseDatos.BDBool("CREATE TABLE `ReqIAuto` (`Id` int not null auto_increment, `IdAutor` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdAutor`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqInfo`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqIDatEsp` (`Id` int not null auto_increment, `IdReq` int not null, `Descrip` varchar(100) not null, primary key(`Id`), foreign key(`IdReq`) references `ReqInfo`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqIFuen` (`Id` int not null auto_increment, `IdFuen` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdFuen`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqInfo`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqIObj` (`Id` int not null auto_increment, `IdObj` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`), foreign key(`IdReq`) references `ReqInfo`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqIReqR` (`Id` int not null auto_increment, `IdReqR` int not null, `TipoReq` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdReq`) references `ReqInfo`(`Id`));", BuilderMySql.ToString(), TipoBD);

                ClsBaseDatos.BDBool("CREATE TABLE `ReqNAuto` (`Id` int not null auto_increment, `IdAutor` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdAutor`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqNFunc`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqNFuen` (`Id` int not null auto_increment, `IdFuen` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdFuen`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqNFunc`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqNObj` (`Id` int not null auto_increment, `IdObj` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`), foreign key(`IdReq`) references `ReqNFunc`(`Id`));", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("CREATE TABLE `ReqNReqR` (`Id` int not null auto_increment, `IdReqR` int not null, `TipoReq` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdReq`) references `ReqNFunc`(`Id`));", BuilderMySql.ToString(), TipoBD);

                ClsBaseDatos.BDBool("INSERT INTO Paquetes(Nombre,Version,Fecha,Categoria,Comentario) VALUES ('No Asignado', 1, '" + ClsFunciones.FechaMySQL(DateTime.Today) + "', 10, '');", BuilderMySql.ToString(), TipoBD);

                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('DSR', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('RTII', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('EUE', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('CIPR', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('RCMBAF', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('IE', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('U', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('CPS', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('ETC', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('HC', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('CS', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('DOTPC', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('UT', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('FWTP', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('AE', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('OOPE', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('LAC', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('M', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('SR', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('PTS', 0);", BuilderMySql.ToString(), TipoBD);
                ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('DPL', 0);", BuilderMySql.ToString(), TipoBD);

                return(0);
            }
            else
            {
                ADOX.Catalog cat     = new ADOX.Catalog();
                string       builder = "Provider=Microsoft.ACE.OLEDB.12.0; " + "Data Source=" + RutaAcc + "; ";
                if (FlgPass)
                {
                    builder += PassAcc;
                }
                try
                {
                    cat.Create(builder);
                    if (!FlgPass)
                    {
                        builder += "Persist Security Info = False;";
                    }

                    ClsBaseDatos.BDBool("CREATE TABLE `Actores` (`Id` AUTOINCREMENT not null, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Descripcion` text not null, `Complejidad` int not null, `DescComple` varchar(100) not null, `Categoria` int not null, `Comentario` Text not null, primary key(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `Grupo` (`Id` AUTOINCREMENT not null, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Organizacion` varchar(100) not null, `Rol` varchar(100) not null, `Desarrollador` int not null, `Categoria` int not null, `Comentario` Text not null, primary key(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `Objetivos` (`Id` AUTOINCREMENT not null, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Descripcion` varchar(100) not null, `Prioridad` int not null, `Urgencia` int not null, `Estabilidad` int not null, `Estado` int not null, `Categoria` int not null, `Comentario` Text not null, primary key(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `Paquetes` (`Id` AUTOINCREMENT not null, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Categoria` int not null, `Comentario` Text not null, primary key(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqFun` (`Id` AUTOINCREMENT not null, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Descripcion` varchar(100) not null, `Paquete` int not null, `Precond` varchar(100) not null, `Postcond` varchar(100) not null, `Complejidad` int not null, `Prioridad` int not null, `Urgencia` int not null, `Estabilidad` int not null, `Estado` int not null, `Categoria` int not null, `Comentario` Text not null, primary key(`Id`), foreign key(`Paquete`) references `paquetes`(`id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqInfo` (`Id` AUTOINCREMENT not null, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Descripcion` varchar(100) not null, `TiemMed` int not null, `TiemMax` int not null, `OcuMed` int not null, `OcuMax` int not null, `Prioridad` int not null, `Urgencia` int not null, `Estabilidad` int not null, `Estado` int not null, `Categoria` int not null, `Comentario` Text not null, primary key(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqNFunc` (`Id` AUTOINCREMENT not null, `Nombre` varchar(100) unique not null, `Version` double not null default 1.0, `Fecha` date, `Descripcion` varchar(100) not null, `Prioridad` int not null, `Urgencia` int not null, `Estabilidad` int not null, `Estado` int not null, `Categoria` int not null, `Comentario` Text not null, primary key(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `Estim` (`NomEst` VARCHAR(10) NOT NULL, `ValEst` INT NOT NULL,  PRIMARY KEY(`NomEst`));", builder, TipoBD);

                    ClsBaseDatos.BDBool("CREATE TABLE `ActAuto` (`Id` AUTOINCREMENT not null, `IdAutor` int not null, `IdAct` int not null, primary key(`Id`), foreign key(`IdAutor`) references `Grupo`(`Id`), foreign key(`IdAct`) references `Actores`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ActFuen` (`Id` AUTOINCREMENT not null , `IdFuen` int not null, `IdAct` int not null, primary key(`Id`), foreign key(`IdFuen`) references `Grupo`(`Id`), foreign key(`IdAct`) references `Actores`(`Id`));", builder, TipoBD);

                    ClsBaseDatos.BDBool("CREATE TABLE `ObjAuto` (`Id` AUTOINCREMENT not null , `IdAutor` int not null, `IdObj` int not null, primary key(`Id`), foreign key(`IdAutor`) references `Grupo`(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ObjFuen` (`Id` AUTOINCREMENT not null , `IdFuen` int not null, `IdObj` int not null, primary key(`Id`), foreign key(`IdFuen`) references `Grupo`(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ObjSubobj` (`Id` AUTOINCREMENT not null , `IdSubobj` int not null, `IdObj` int not null, primary key(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`));", builder, TipoBD);

                    ClsBaseDatos.BDBool("CREATE TABLE `ReqAct` (`Id` AUTOINCREMENT not null , `IdAct` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdAct`) references `Actores`(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqAuto` (`Id` AUTOINCREMENT not null , `IdAutor` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdAutor`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqFuen` (`Id` AUTOINCREMENT not null , `IdFuen` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdFuen`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqObj` (`Id` AUTOINCREMENT not null , `IdObj` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqReqR` (`Id` AUTOINCREMENT not null , `IdReqR` int not null, `TipoReq` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqSecExc` (`Id` AUTOINCREMENT not null , `IdReq` int not null, `Descrip` varchar(100) not null, primary key(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqSecNor` (`Id` AUTOINCREMENT not null , `IdReq` int not null, `Descrip` varchar(100) not null, primary key(`Id`), foreign key(`IdReq`) references `ReqFun`(`Id`));", builder, TipoBD);

                    ClsBaseDatos.BDBool("CREATE TABLE `ReqIAuto` (`Id` AUTOINCREMENT not null , `IdAutor` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdAutor`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqInfo`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqIDatEsp` (`Id` AUTOINCREMENT not null , `IdReq` int not null, `Descrip` varchar(100) not null, primary key(`Id`), foreign key(`IdReq`) references `ReqInfo`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqIFuen` (`Id` AUTOINCREMENT not null , `IdFuen` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdFuen`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqInfo`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqIObj` (`Id` AUTOINCREMENT not null , `IdObj` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`), foreign key(`IdReq`) references `ReqInfo`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqIReqR` (`Id` AUTOINCREMENT not null , `IdReqR` int not null, `TipoReq` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdReq`) references `ReqInfo`(`Id`));", builder, TipoBD);

                    ClsBaseDatos.BDBool("CREATE TABLE `ReqNAuto` (`Id` AUTOINCREMENT not null , `IdAutor` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdAutor`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqNFunc`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqNFuen` (`Id` AUTOINCREMENT not null , `IdFuen` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdFuen`) references `Grupo`(`Id`), foreign key(`IdReq`) references `ReqNFunc`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqNObj` (`Id` AUTOINCREMENT not null , `IdObj` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdObj`) references `Objetivos`(`Id`), foreign key(`IdReq`) references `ReqNFunc`(`Id`));", builder, TipoBD);
                    ClsBaseDatos.BDBool("CREATE TABLE `ReqNReqR` (`Id` AUTOINCREMENT not null , `IdReqR` int not null, `TipoReq` int not null, `IdReq` int not null, primary key(`Id`), foreign key(`IdReq`) references `ReqNFunc`(`Id`));", builder, TipoBD);

                    ClsBaseDatos.BDBool("INSERT INTO Paquetes(Nombre,Version,Fecha,Categoria,Comentario) VALUES ('No Asignado', 1, '" + ClsFunciones.FechaMySQL(DateTime.Today) + "', 10, '');", builder, TipoBD);

                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('DSR', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('RTII', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('EUE', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('CIPR', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('RCMBAF', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('IE', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('U', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('CPS', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('ETC', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('HC', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('CS', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('DOTPC', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('UT', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('FWTP', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('AE', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('OOPE', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('LAC', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('M', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('SR', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('PTS', 0);", builder, TipoBD);
                    ClsBaseDatos.BDBool("INSERT INTO Estim(NomEst, ValEst) VALUES('DPL', 0);", builder, TipoBD);
                }
                catch
                {
                    return(-2);
                }
            }
            return(0);
        }
コード例 #8
0
 public int Guardar()
 {
     if (Id != 0)
     {
         if (!ClsBaseDatos.BDBool("Update Paquetes Set Nombre = '" + Nombre + "', Version = " + ClsFunciones.DoubleToString(Version) + ", Fecha = '" + ClsFunciones.FechaMySQL(Fecha) + "', Categoria = " + Categoria + ", Comentario = '" + Comentario + "' where Id = " + Id + ";"))
         {
             return(-1);
         }
     }
     else
     if (!ClsBaseDatos.BDBool("Insert into Paquetes(Nombre,Version,Fecha,Categoria,Comentario) values ('" + Nombre + "'," + ClsFunciones.DoubleToString(Version) + ",'" + ClsFunciones.FechaMySQL(Fecha) + "'," + Categoria + ",'" + Comentario + "');"))
     {
         return(-2);
     }
     return(0);
 }