예제 #1
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);
 }
예제 #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()
        {
            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);
        }
예제 #4
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);
        }
예제 #5
0
        public void CargarValores()
        {
            //TCF
            DSR  = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'DSR'"));
            RTII = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'RTII'"));
            EUE  = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'EUE'"));
            CIPR = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'CIPR'"));

            RCMBAF = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'RCMBAF'"));
            IE     = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'IE'"));
            U      = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'U'"));
            CPS    = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'CPS'"));

            ETC   = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'ETC'"));
            HC    = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'HC'"));
            CS    = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'CS'"));
            DOTPC = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'DOTPC'"));
            UT    = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'UT'"));

            //EF
            FWTP = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'FWTP'"));
            AE   = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'AE'"));
            OOPE = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'OOPE'"));
            LAC  = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'LAC'"));

            M   = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'M'"));
            SR  = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'SR'"));
            PTS = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'PTS'"));
            DPL = Convert.ToInt32(ClsBaseDatos.BDDouble("Select ValEst From Estim where NomEst = 'DPL'"));

            //UUCP
            UUCPSim = Convert.ToInt32(ClsBaseDatos.BDDouble("Select Count(*) From ReqFun where Complejidad = 1")); //Simple
            UUCPMed = Convert.ToInt32(ClsBaseDatos.BDDouble("Select Count(*) From ReqFun where Complejidad = 2")); //Media
            UUCPMax = Convert.ToInt32(ClsBaseDatos.BDDouble("Select Count(*) From ReqFun where Complejidad = 3")); //Alta

            //AW
            AWSim = Convert.ToInt32(ClsBaseDatos.BDDouble("Select Count(*) From Actores where Complejidad = 1")); //Simple
            AWMed = Convert.ToInt32(ClsBaseDatos.BDDouble("Select Count(*) From Actores where Complejidad = 2")); //Media
            AWMax = Convert.ToInt32(ClsBaseDatos.BDDouble("Select Count(*) From Actores where Complejidad = 3")); //Alta
        }
예제 #6
0
        public int ComprobarExistencia(string valor)
        {
            int id = (int)ClsBaseDatos.BDDouble("Select Id from Grupo where Nombre = '" + valor + "';");

            return((id != -1) ? id : -1);
        }