private void CargarRequisito(int id = -1) { if (id == -1) { Requisito.Cargar(int.Parse(Convert.ToString(((DataRowView)DGBuscar.Items[DGBuscar.SelectedIndex]).Row.ItemArray[1])), TipoReq); } else { Requisito.Cargar(id); } TxtNom.Text = Requisito.Nombre; TxtVer.Text = ClsFunciones.DoubleToString(Requisito.Version); TxtFec.Text = Requisito.Fecha.ToShortDateString(); TxtDesc.Text = Requisito.Descripcion; RadioButtonValor(false); CmbCat.Text = Requisito.Categoria.ToString(); TxtCom.Text = Requisito.Comentario; DGObjetivos.ItemsSource = Requisito.Objetivos.DefaultView; DGFuentes.ItemsSource = Requisito.Fuentes.DefaultView; DGAutores.ItemsSource = Requisito.Autores.DefaultView; DGReqRel.ItemsSource = Requisito.Requisitos.DefaultView; DGGruAut.ItemsSource = Requisito.BGrupo.DefaultView; DGGruFuen.ItemsSource = Requisito.BFuentes.DefaultView; DGObjObj.ItemsSource = Requisito.BObjetivos.DefaultView; DGRequi.ItemsSource = Requisito.BRequisitos.DefaultView; Activo = true; Base = true; Requisito.Buscador.Rows.Clear(); }
private void CargarPersona(int id = -1) { if (id == -1) { Trabajador.Cargar(int.Parse(Convert.ToString(((DataRowView)DGBuscar.Items[DGBuscar.SelectedIndex]).Row.ItemArray[1]))); } else { Trabajador.Cargar(id); } TxtNom.Text = Trabajador.Nombre; TxtVer.Text = ClsFunciones.DoubleToString(Trabajador.Version); TxtFec.Text = Trabajador.Fecha.ToShortDateString(); TxtOrg.Text = Trabajador.Organizacion; TxtRol.Text = Trabajador.Rol; if (Trabajador.Desarrollador) { RBSi.IsChecked = true; } else { RBNo.IsChecked = true; } CmbCat.Text = Trabajador.Categoria.ToString(); TxtCom.Text = Trabajador.Comentario; Activo = true; Base = true; Trabajador.Buscador.Rows.Clear(); }
public static void ReqNFun(Application oWord, Document oDoc, DataRow fila, DataRow[] Auto, DataRow[] Fuen, DataRow[] Obj, ArrayList Req) { Table oTable; oTable = oDoc.Tables.Add(oDoc.Bookmarks[DefValues.FinFichero].Range, 12, 2); oTable.Range.ParagraphFormat.SpaceAfter = 3; oTable.Borders.Enable = 1; oTable.Cell(1, 1).Range.Text = fila[0].ToString(); oTable.Cell(1, 2).Range.Text = fila[2].ToString(); oTable.Cell(2, 2).Range.Text = ClsFunciones.DoubleToString((double)fila[3]) + " (" + ((DateTime)fila[4]).ToShortDateString() + ")"; oTable.Cell(3, 2).Range.Text = fila[5].ToString(); oTable.Cell(4, 2).Range.Text = GeneraInfo(Auto); oTable.Cell(5, 2).Range.Text = GeneraInfo(Fuen); oTable.Cell(6, 2).Range.Text = GeneraInfo(Obj, DefValues.DataRow, false); oTable.Cell(7, 2).Range.Text = GeneraInfo(Req, DefValues.ArrayList); oTable.Cell(8, 2).Range.Text = fila[6].ToString(); oTable.Cell(9, 2).Range.Text = fila[7].ToString(); oTable.Cell(10, 2).Range.Text = fila[8].ToString(); oTable.Cell(11, 2).Range.Text = fila[9].ToString(); oTable.Cell(12, 2).Range.Text = fila[10].ToString(); if (ClsConf.Idioma.Equals(DefValues.Ingles)) { oTable.Cell(2, 1).Range.Text = Ingles.Version; oTable.Cell(3, 1).Range.Text = Ingles.Description; oTable.Cell(4, 1).Range.Text = Ingles.Authors; oTable.Cell(5, 1).Range.Text = Ingles.Sources; oTable.Cell(6, 1).Range.Text = Ingles.RelObjet; oTable.Cell(7, 1).Range.Text = Ingles.RelRequi; oTable.Cell(8, 1).Range.Text = Ingles.Priority; oTable.Cell(9, 1).Range.Text = Ingles.Urgency; oTable.Cell(10, 1).Range.Text = Ingles.Stability; oTable.Cell(11, 1).Range.Text = Ingles.State; oTable.Cell(12, 1).Range.Text = Ingles.Commentary; } else { oTable.Cell(2, 1).Range.Text = Español.Version; oTable.Cell(3, 1).Range.Text = Español.Descripción; oTable.Cell(4, 1).Range.Text = Español.Autores; oTable.Cell(5, 1).Range.Text = Español.Fuentes; oTable.Cell(6, 1).Range.Text = Español.RelObjet; oTable.Cell(7, 1).Range.Text = Español.RelRequi; oTable.Cell(8, 1).Range.Text = Español.Prioridad; oTable.Cell(9, 1).Range.Text = Español.Urgencia; oTable.Cell(10, 1).Range.Text = Español.Estabilidad; oTable.Cell(11, 1).Range.Text = Español.Estado; oTable.Cell(12, 1).Range.Text = Español.Comentario; } Negrita(oTable, 12); oTable.Columns[1].Width = oWord.InchesToPoints(1); oTable.Columns[2].Width = oWord.InchesToPoints(5); oTable.Columns[1].Shading.BackgroundPatternColor = WdColor.wdColorGray125; oTable.Rows[1].Shading.BackgroundPatternColor = WdColor.wdColorGray125; oDoc.Content.Paragraphs.Add(oDoc.Bookmarks[DefValues.FinFichero].Range); }
private void CargarPaquete(int id = -1) { if (id == -1) Paquete.Cargar(int.Parse(Convert.ToString(((DataRowView)DGBuscar.Items[DGBuscar.SelectedIndex]).Row.ItemArray[1]))); else Paquete.Cargar(id); TxtNom.Text = Paquete.Nombre; TxtVer.Text = ClsFunciones.DoubleToString(Paquete.Version); TxtFec.Text = Paquete.Fecha.ToShortDateString(); CmbCat.Text = Paquete.Categoria.ToString(); TxtCom.Text = Paquete.Comentario; Activo = true; Base = true; Paquete.Buscador.Rows.Clear(); }
public static void Grupo(Application oWord, Document oDoc, DataRow fila) { Table oTable; oTable = oDoc.Tables.Add(oDoc.Bookmarks[DefValues.FinFichero].Range, 6, 2); //Filas y columnas oTable.Range.ParagraphFormat.SpaceAfter = 3; //Espacio despues de la tabla oTable.Borders.Enable = 1; //Dibuja bordes en la tabla oTable.Cell(1, 1).Range.Text = fila[0].ToString(); oTable.Cell(1, 2).Range.Text = fila[2].ToString(); oTable.Cell(2, 2).Range.Text = ClsFunciones.DoubleToString((double)fila[3]) + " (" + ((DateTime)fila[4]).ToShortDateString() + ")"; oTable.Cell(3, 2).Range.Text = fila[5].ToString(); oTable.Cell(4, 2).Range.Text = fila[6].ToString(); oTable.Cell(5, 2).Range.Text = fila[7].ToString(); oTable.Cell(6, 2).Range.Text = fila[8].ToString(); if (ClsConf.Idioma.Equals(DefValues.Ingles)) { oTable.Cell(2, 1).Range.Text = Ingles.Version; oTable.Cell(3, 1).Range.Text = Ingles.Organization; oTable.Cell(4, 1).Range.Text = Ingles.Role; oTable.Cell(5, 1).Range.Text = Ingles.IsDev; oTable.Cell(6, 1).Range.Text = Ingles.Commentary; oTable.Columns[1].Width = oWord.InchesToPoints(1);//Ancho columna 1 } else { oTable.Cell(2, 1).Range.Text = Español.Version; oTable.Cell(3, 1).Range.Text = Español.Organización; oTable.Cell(4, 1).Range.Text = Español.Rol; oTable.Cell(5, 1).Range.Text = Español.Es_Des; oTable.Cell(6, 1).Range.Text = Español.Comentario; oTable.Columns[1].Width = oWord.InchesToPoints(1.25f);//Ancho columna 1 } Negrita(oTable, 6); //Negrita columna 1 y fila 1 columna 2 oTable.Columns[2].Width = oWord.InchesToPoints(5); oTable.Columns[1].Shading.BackgroundPatternColor = WdColor.wdColorGray125; //Color fondo columna 1 oTable.Rows[1].Shading.BackgroundPatternColor = WdColor.wdColorGray125; //color fondo fila 1 columna 2 oDoc.Content.Paragraphs.Add(oDoc.Bookmarks[DefValues.FinFichero].Range); //Añade tabla a documento }
public static void Actores(Application oWord, Document oDoc, DataRow fila, DataRow[] Auto, DataRow[] Fuen) { Table oTable; oTable = oDoc.Tables.Add(oDoc.Bookmarks[DefValues.FinFichero].Range, 7, 2); oTable.Range.ParagraphFormat.SpaceAfter = 3; oTable.Borders.Enable = 1; oTable.Cell(1, 1).Range.Text = fila[0].ToString(); oTable.Cell(1, 2).Range.Text = fila[2].ToString(); oTable.Cell(2, 2).Range.Text = ClsFunciones.DoubleToString((double)fila[3]) + " (" + ((DateTime)fila[4]).ToShortDateString() + ")"; oTable.Cell(3, 2).Range.Text = fila[5].ToString(); oTable.Cell(4, 2).Range.Text = GeneraInfo(Auto); oTable.Cell(5, 2).Range.Text = GeneraInfo(Fuen); oTable.Cell(6, 2).Range.Text = fila[6].ToString() + " (" + fila[7].ToString() + ")"; oTable.Cell(7, 2).Range.Text = fila[8].ToString(); if (ClsConf.Idioma.Equals(DefValues.Ingles)) { oTable.Cell(2, 1).Range.Text = Ingles.Version; oTable.Cell(3, 1).Range.Text = Ingles.Description; oTable.Cell(4, 1).Range.Text = Ingles.Authors; oTable.Cell(5, 1).Range.Text = Ingles.Sources; oTable.Cell(6, 1).Range.Text = Ingles.Complexity; oTable.Cell(7, 1).Range.Text = Ingles.Commentary; } else { oTable.Cell(2, 1).Range.Text = Español.Version; oTable.Cell(3, 1).Range.Text = Español.Descripción; oTable.Cell(4, 1).Range.Text = Español.Autores; oTable.Cell(5, 1).Range.Text = Español.Fuentes; oTable.Cell(6, 1).Range.Text = Español.Complejidad; oTable.Cell(7, 1).Range.Text = Español.Comentario; } Negrita(oTable, 7); oTable.Columns[1].Width = oWord.InchesToPoints(1); oTable.Columns[2].Width = oWord.InchesToPoints(5); oTable.Columns[1].Shading.BackgroundPatternColor = WdColor.wdColorGray125; oTable.Rows[1].Shading.BackgroundPatternColor = WdColor.wdColorGray125; oDoc.Content.Paragraphs.Add(oDoc.Bookmarks[DefValues.FinFichero].Range); }
private void CargarActor(int id = -1) { if (id == -1) { Actor.Cargar(int.Parse(Convert.ToString(((DataRowView)DGBuscar.Items[DGBuscar.SelectedIndex]).Row.ItemArray[1]))); } else { Actor.Cargar(id); } TxtNom.Text = Actor.Nombre; TxtVer.Text = ClsFunciones.DoubleToString(Actor.Version); TxtFec.Text = Actor.Fecha.ToShortDateString(); TxtDesc.Text = Actor.Descripcion.ToString(); if (Actor.Complejidad == 1) { RBCB.IsChecked = true; } else if (Actor.Complejidad == 2) { RBCM.IsChecked = true; } else if (Actor.Complejidad == 3) { RBCA.IsChecked = true; } TxtDescCom.Text = Actor.DescComplejidad; CmbCat.Text = Actor.Categoria.ToString(); TxtCom.Text = Actor.Comentario; DGFuentes.ItemsSource = Actor.Fuentes.DefaultView; DGAutores.ItemsSource = Actor.Autores.DefaultView; DGGruAut.ItemsSource = Actor.BGrupo.DefaultView; DGGruFuen.ItemsSource = Actor.BFuentes.DefaultView; Activo = true; Base = true; Actor.Buscador.Rows.Clear(); }
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); }
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); }
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); }
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); }
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); }
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); } }
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); }