Example #1
0
        //AL seleccionar la notificacion y pulsar en eliminar nos lo pasa a la lista de notificacines base eliminandola de las seleccionadas
        private void buttonEliminarNot_Click(object sender, EventArgs e)
        {
            notificaciones notificacionEliminar = new notificaciones();

            if (listBoxNotificacionesSelec.SelectedItem != null)
            {
                notificacionEliminar.antelacion = ((notificaciones)listBoxNotificacionesSelec.SelectedItem).antelacion;
                bindingSourceNotificaciones.Add(notificacionEliminar);
                bindingSourceNotificacionesGuardar.RemoveAt(listBoxNotificacionesSelec.SelectedIndex);
                bindingSourceNotificaciones.Sort = "antelacion ASC";
            }
            else
            {
                MessageBox.Show(Strings.errorNotification, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        //AL seleccionar la notificacion y pulsar en añadir nos lo pasa a la lista de notificacines seleccionadas
        private void buttonAñadirNot_Click(object sender, EventArgs e)
        {
            notificaciones notificacionNueva = new notificaciones();

            if (listBoxNotificacionesBase.SelectedItem != null)
            {
                notificacion.Add((notificaciones)listBoxNotificacionesBase.SelectedItem);
                bindingSourceNotificacionesGuardar.DataSource = null;
                bindingSourceNotificacionesGuardar.DataSource = notificacion;
                bindingSourceNotificaciones.RemoveAt(listBoxNotificacionesBase.SelectedIndex);
            }
            else
            {
                MessageBox.Show(Strings.errorNotification, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }