private void WLoaded(object sender, RoutedEventArgs e) { if (!ClsConf.Iniciar()) { TxtCon.Text = "ConfiguraciĆ³n\nConfiguration"; TxtNuP.Text = "Nuevo Proyecto\nNew Project"; } else { Activo = true; Idioma(); } }
private int Importar() { ArrayList BaseDatos = new ArrayList(); int cont = 0; try { StreamReader sr = new StreamReader(LblRutaBD.Content + ""); string line = ""; while (line != null) { cont++; line = sr.ReadLine(); if (!string.IsNullOrEmpty(line)) { BaseDatos.Add(ClsConf.Desencriptar(line)); } } sr.Close(); } catch { return(-1); } PBProg.Maximum = cont--; foreach (string line in BaseDatos) { if (!string.IsNullOrEmpty(line)) { if (!ClsBaseDatos.BDBool(line)) { if (!line.Substring(0, 6).Equals("Delete")) { MessageBox.Show(line); return(-2); } } PBProg.Value++; DoEvents(); } } return(0); }
private void ButClick(object sender, RoutedEventArgs e) { ctrl = (Control)sender; if (ctrl.Name.Equals("ButRuta")) { WinForms.FolderBrowserDialog browse = new WinForms.FolderBrowserDialog(); browse.ShowDialog(); LblRutaBD.Content = browse.SelectedPath; } if (ctrl.Name.Equals("ButCrear")) { if (RBSql.IsChecked == true) { if (string.IsNullOrEmpty(TxtHost.Text) || string.IsNullOrEmpty(TxtUsu.Text) || string.IsNullOrEmpty(TxtPassMS.Password) || string.IsNullOrEmpty(TxtBDMS.Text) || string.IsNullOrEmpty(TxtPortMS.Text)) { MessageBox.Show(StrMenPar); return; } else { NuevoProyecto.TipoBD = DefValues.MySql; NuevoProyecto.Host = TxtHost.Text; NuevoProyecto.Usuario = TxtUsu.Text; NuevoProyecto.PassMySql = TxtPassMS.Password; NuevoProyecto.BDMySql = TxtBDMS.Text; NuevoProyecto.PortMySql = TxtPortMS.Text; NuevoProyecto.CreateMySql = (ChkCreBase.IsChecked == true) ? true : false; } } else { //access string RutaBD = "" + LblRutaBD.Content; if (string.IsNullOrEmpty(RutaBD)) { MessageBox.Show(StrMenPar); return; } else { NuevoProyecto.TipoBD = DefValues.Access; NuevoProyecto.RutaAcc = RutaBD + "\\" + TxtNomBD.Text + ".accdb"; if (!string.IsNullOrEmpty(TxtPassBD.Password)) { NuevoProyecto.FlgPass = true; NuevoProyecto.PassAcc = "Jet OLEDB:Database Password ="******";"; } else { NuevoProyecto.FlgPass = false; NuevoProyecto.PassAcc = "Persist Security Info = False;"; } } } int resultado = NuevoProyecto.CrearBase(); if (resultado == -1) { MessageBox.Show(StrMenCon); } else if (resultado == -2) { MessageBox.Show(StrMenExi); } else { if (MessageBox.Show(StrMenPre, StrConf, MessageBoxButton.YesNo) == MessageBoxResult.Yes) { ClsConf.TipoBD = NuevoProyecto.TipoBD; if (RBSql.IsChecked == true) { ClsConf.Host = NuevoProyecto.Host; ClsConf.Usuario = NuevoProyecto.Usuario; ClsConf.PassMySql = NuevoProyecto.PassMySql; ClsConf.BDMySql = NuevoProyecto.BDMySql; ClsConf.PortMySql = NuevoProyecto.PortMySql; ClsConf.ConexionMySql(); } else { ClsConf.RutaAcc = NuevoProyecto.RutaAcc; ClsConf.FlgPass = NuevoProyecto.FlgPass; if (NuevoProyecto.FlgPass) { ClsConf.PassAcc = NuevoProyecto.PassAcc.Substring(29, NuevoProyecto.PassAcc.Length - 30); } else { ClsConf.PassAcc = string.Empty; } } if (ClsConf.EscribirConf() == -1) { MessageBox.Show(StrMenFic); } MessageBox.Show(StrMenCorrec); } } Close(); } }
private void ButClick(object sender, RoutedEventArgs e) { ctrl = (Control)sender; if (ctrl.Name.Equals("ButRuta")) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = StrMenArc + "|*.accdb"; openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); if (openFileDialog.ShowDialog() == true) { LblRutaBD.Content = openFileDialog.FileName; } } if (ctrl.Name.Equals("ButSalir")) { if (RBSql.IsChecked == true) { if (string.IsNullOrEmpty(TxtHost.Text) || string.IsNullOrEmpty(TxtUsu.Text) || string.IsNullOrEmpty(TxtPassMS.Password) || string.IsNullOrEmpty(TxtBDMS.Text) || string.IsNullOrEmpty(TxtPortMS.Text)) { MessageBox.Show(StrMenPar); if (MessageBox.Show(StrMenSal, Title, MessageBoxButton.YesNo) == MessageBoxResult.Yes) { Close(); return; } else { return; } } else { ClsConf.TipoBD = DefValues.MySql; ClsConf.Host = TxtHost.Text; ClsConf.Usuario = TxtUsu.Text; ClsConf.PassMySql = TxtPassMS.Password; ClsConf.BDMySql = TxtBDMS.Text; ClsConf.PortMySql = TxtPortMS.Text; } } else { string RutaBD = "" + LblRutaBD.Content; if (string.IsNullOrEmpty(RutaBD)) { MessageBox.Show(StrMenPar); if (MessageBox.Show(StrMenSal, Title, MessageBoxButton.YesNo) == MessageBoxResult.Yes) { Close(); return; } else { return; } } else { ClsConf.TipoBD = DefValues.Access; ClsConf.RutaAcc = RutaBD; if (!string.IsNullOrEmpty(TxtPassBD.Password)) { ClsConf.FlgPass = true; ClsConf.PassAcc = TxtPassBD.Password; } else { ClsConf.FlgPass = false; } } } if (ClsConf.EscribirConf() == -1) { MessageBox.Show(StrMenFic); if (MessageBox.Show(StrMenSal, Title, MessageBoxButton.YesNo) == MessageBoxResult.Yes) { Close(); } else { return; } } else { string OptionCon = Ingles.No; if (ClsConf.TipoBD.Equals(DefValues.MySql)) { ClsConf.ConexionMySql(); } else { OptionCon = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + ClsConf.RutaAcc + "; "; if (ClsConf.FlgPass) { OptionCon += "Jet OLEDB:Database Password ="******";"; } else { OptionCon += "Persist Security Info = False;"; } } if (!ClsBaseDatos.BDConexion(OptionCon)) { MessageBox.Show(StrMenConBD); if (MessageBox.Show(StrMenSal, Title, MessageBoxButton.YesNo) == MessageBoxResult.Yes) { Close(); } } else { Close(); } } } }
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); } }
private void Click(object sender, RoutedEventArgs e) { ctrl = ((Control)sender); if (ctrl.Name.Equals("ButGru") && !Grupo.IsLoaded && Activo) { Grupo = new WinGrupo(); Grupo.Owner = this; Grupo.Show(); } if (ctrl.Name.Equals("ButPaq") && !Paquetes.IsLoaded && Activo) { Paquetes = new WinPaq(); Paquetes.Owner = this; Paquetes.Show(); } if (ctrl.Name.Equals("ButObj") && !Objetivos.IsLoaded && Activo) { Objetivos = new WinObjetivos(); Objetivos.Owner = this; Objetivos.Show(); } if (ctrl.Name.Equals("ButAct") && !Actores.IsLoaded && Activo) { Actores = new WinActores(); Actores.Owner = this; Actores.Show(); } if (ctrl.Name.Equals("ButRIn") && !ReqInfo.IsLoaded && Activo) { ReqInfo = new WinReqInfo(); ReqInfo.Owner = this; ReqInfo.Show(); } if (ctrl.Name.Equals("ButRFu") && !ReqFun.IsLoaded && Activo) { ReqFun = new WinReqFun(); ReqFun.Owner = this; ReqFun.Show(); } if (ctrl.Name.Equals("ButRNF") && !ReqNFun.IsLoaded && Activo) { ReqNFun = new WinReqNFun(); ReqNFun.Owner = this; ReqNFun.Show(); } if (ctrl.Name.Equals("ButCon") && !Configuracion.IsLoaded) { Configuracion = new WinConf(); Configuracion.Owner = this; Configuracion.ShowDialog(); Activo = true; if (ClsConf.TipoBD == DefValues.MySql) { ClsConf.ConexionMySql(); } Idioma(); } if (ctrl.Name.Equals("ButNuP") && !NuevoPro.IsLoaded) { NuevoPro = new WinNuePro(); NuevoPro.Owner = this; NuevoPro.ShowDialog(); if (!Activo) { MessageBox.Show(StrMenConf); } } if (ctrl.Name.Equals("ButImp") && !Importar.IsLoaded && Activo) { Importar = new WinImpor(); Importar.Owner = this; Importar.ShowDialog(); } if (ctrl.Name.Equals("ButExp") && !Exportar.IsLoaded && Activo) { Exportar = new WinExpor(); Exportar.Owner = this; Exportar.ShowDialog(); } if (ctrl.Name.Equals("ButWord") && !Word.IsLoaded && Activo) { Word = new WinWord(); Word.Owner = this; Word.ShowDialog(); } if (ctrl.Name.Equals("ButEstim") && !Estim.IsLoaded && Activo) { Estim = new WinEstim(); Estim.Owner = this; Estim.Show(); } }