Exemplo n.º 1
0
 protected override void Actualizar()
 {
     try
     {
         z_guardia guardia = new z_guardia().getObjectz_guardia((int)listActuales.SelectedValue);
         guardia.tipo_oficial      = textTipoOficial.Text;
         guardia.oficial           = textOficial.Text;
         guardia.responsabilidades = textResponsabilidades.Text;
         guardia.mostrar           = checkMostrar.Checked;
         guardia.modifyz_guardia(guardia);
         MessageBox.Show("Operación realizada correctamente.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
         Source = guardia.Getz_guardia().Tables[0];
     }
     catch (Exception e)
     {
         Log.ShowAndLog(e);
     }
 }
Exemplo n.º 2
0
 protected override void Insertar()
 {
     try
     {
         var guardia = new z_guardia
         {
             tipo_oficial      = textTipoOficial.Text,
             oficial           = textOficial.Text,
             responsabilidades = textResponsabilidades.Text,
             mostrar           = checkMostrar.Checked
         };
         guardia.addz_guardia(guardia);
         MessageBox.Show("Operación realizada correctamente.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
         Source = guardia.Getz_guardia().Tables[0];
     }
     catch (Exception e)
     {
         Log.ShowAndLog(e);
     }
 }