public CampoDateTime(string tipoDato, int longitudValores, string nombre, bool esPrimaryKey, bool esNulo, string nombreTabla, string database, bool seCrara)
 {
     TipoDato   = tipoDato;
     Nombre     = nombre;
     PrimaryKey = esPrimaryKey;
     Nulo       = esNulo;
     if (!Existe("databases/" + database + "/" + nombreTabla + ".campos.minsql") && seCrara)
     {
         ListaDoblementeEnlazada <string> ListaCampos = new ListaDoblementeEnlazada <string>("databases/" + database + "/" + nombreTabla + ".campos.minsql", Estructuras_de_Datos.Comunes.IFabricaTextoTamañoFijo <string>);
     }
 }
Beispiel #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         if (textBox5.Text == "" || comboBox1.SelectedIndex == -1)
         {
             MessageBox.Show("Debe llenar todos los campos.");
         }
         else
         {
             if (actualizar)
             {
                 ListaDoblementeEnlazada <Reglamento> reglamentos = Program.Leyes.Buscar(posicionActualizar).Reglamentos;
                 Program.Leyes.Actualizar(posicionActualizar, new Leyes(textBox5.Text, Convert.ToInt32(numericUpDown2.Value), reglamentos));
                 button3.Text       = "Guardar";
                 posicionActualizar = -1;
                 actualizar         = false;
             }
             else
             {
                 bool  agregar = true;
                 Leyes ley     = null;
                 for (int i = 0; i <= Program.Leyes.Cantidad; i++)
                 {
                     ley = Program.Leyes.Buscar(i);
                     if (ley.Nombre == textBox5.Text)
                     {
                         agregar = false;
                     }
                 }
                 if (agregar)
                 {
                     Program.Leyes.Agregar(new Leyes(textBox5.Text, Convert.ToInt32(numericUpDown2.Value),
                                                     Program.Reglamentos.Buscar(comboBox1.SelectedIndex)));
                 }
                 else
                 {
                     MessageBox.Show("La ley ya existe");
                 }
             }
             cargarLeyes();
             cargarLeyesCombo();
             cargarLeyesCombo1();
             Program.Leyes.Guardar();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }