Example #1
0
 private void buttonNuevo_Click(object sender, EventArgs e)
 {
     try
     {
         cFMDE110010 Catalogo = new cFMDE110010();
         AddOwnedForm(Catalogo);
         Catalogo.FormBorderStyle = FormBorderStyle.None;
         Catalogo.TopLevel        = false;
         Catalogo.Dock            = DockStyle.Fill;
         this.Controls.Add(Catalogo);
         this.Tag = Catalogo;
         Catalogo.BringToFront();
         Catalogo.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(String.Format("buttonNuevo_Click: {0}", ex), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #2
0
 private void buttonEditar_Click(object sender, EventArgs e)
 {
     try
     {
         if (dataGridViewDepartamento.RowCount > 0)
         {
             IdRowSelect = dataGridViewDepartamento.CurrentRow.Index;
             if (IdRowSelect >= 0)
             {
                 cFMDE110010 Catalogo = new cFMDE110010();
                 Catalogo.IdDepartament           = Int32.Parse(dataGridViewDepartamento.Rows[IdRowSelect].Cells["Id"].Value.ToString());
                 Catalogo.textBoxNombre.Text      = dataGridViewDepartamento.Rows[IdRowSelect].Cells["Nombre"].Value.ToString();
                 Catalogo.textBoxEncargado.Text   = dataGridViewDepartamento.Rows[IdRowSelect].Cells["Encargado"].Value.ToString();
                 Catalogo.textBoxDescripcion.Text = dataGridViewDepartamento.Rows[IdRowSelect].Cells["Descripcion"].Value.ToString();
                 AddOwnedForm(Catalogo);
                 Catalogo.FormBorderStyle = FormBorderStyle.None;
                 Catalogo.TopLevel        = false;
                 Catalogo.Dock            = DockStyle.Fill;
                 this.Controls.Add(Catalogo);
                 this.Tag = Catalogo;
                 Catalogo.BringToFront();
                 Catalogo.Show();
             }
             else
             {
                 cFAT100010 Alert = new cFAT100010("InformaciĆ³n", "No tiene Seleccionado un Departamento", MessageBoxIcon.Information);
                 Alert.ShowDialog();
             }
         }
         else
         {
             cFAT100010 Alert = new cFAT100010("InformaciĆ³n", "No hay datos", MessageBoxIcon.Information);
             Alert.ShowDialog();
         }
     }catch (Exception ex)
     {
         MessageBox.Show(String.Format("buttonEditar_Click: {0}", ex), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }