Пример #1
0
 private void btnEditar_Click(object sender, EventArgs e)
 {
     if (this.dgvAgenda.RowCount > 0)
     {
         PanelRegistroPlan.Enabled = true;
         Funcion = 2;
         List <Entidades.Agenda> _plan = new List <Entidades.Agenda>();
         idAgendaSeleccionado = Convert.ToInt32(this.dgvAgenda.CurrentRow.Cells[0].Value);
         List <Entidades.Agenda> ListaRecordatorio = AgendaNeg.BuscarRecordatorio(idAgendaSeleccionado);
         if (ListaRecordatorio.Count > 0)
         {
             foreach (var item in ListaRecordatorio)
             {
                 if (item.idUsuario > 0)
                 {
                     chcPersonal.Checked = true;
                 }
                 if (item.UsuariosSistema > 0)
                 {
                     chcUsuarios.Checked = true;
                 }
                 if (item.Email > 0)
                 {
                     chcEmail.Checked = true;
                 }
             }
         }
         dtFecha.Value       = Convert.ToDateTime(dgvAgenda.CurrentRow.Cells[1].Value.ToString());
         txtDescripcion.Text = dgvAgenda.CurrentRow.Cells[2].Value.ToString();
     }
     else
     {
         const string message2 = "Debe seleccionar un recordatorio de la grilla.";
         const string caption2 = "Atención";
         var          result2  = MessageBox.Show(message2, caption2,
                                                 MessageBoxButtons.OK,
                                                 MessageBoxIcon.Asterisk);
     }
 }