Пример #1
0
 private void registrarPagoToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         String          ID    = dataGridView1.CurrentRow.Cells[0].Value.ToString();
         TallerAsistente asisT = control.obtenerAsistenteTaller(ID);
         FormPago        fp    = new FormPago(asisT.restante, "Pago de Taller");
         fp.ShowDialog();
         Pago pago = fp.getPagos();
         fp.Dispose();
         if (control.registrarPagoAsistenciaTaller(pago, asisT.ID.ToString()))
         {
             MessageBox.Show("Pago registrado exitosamente");
             DocumentosWord word = new DocumentosWord(pago);
             btnActualizar_Click(null, null);
         }
         else
         {
             throw new Exception("Error al registrar pago");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #2
0
        public FormInscricionTaller(string idTaller, TallerAsistente asistente)
        {
            InitializeComponent();
            control = ControlIicaps.getInstance();
            List <String> auxNombres = new List <string>();

            auxId = new List <string>();
            try
            {
                foreach (Taller p in control.obtenerTalleres())
                {
                    auxNombres.Add(p.nombre);
                    auxId.Add(p.id.ToString());
                }
                cmbTalleres.DataSource = auxNombres;
                if (idTaller != null)
                {
                    cmbTalleres.SelectedIndex = auxId.IndexOf(idTaller);
                    cmbTalleres.Enabled       = false;
                }
            }
            catch (Exception ex)
            {
            }
            cmbTipoCosto.SelectedIndex = 0;
            if (asistente != null)
            {
                asistenT = asistente;
                cmbTalleres.SelectedIndex = auxId.IndexOf(asistente.taller.ToString());
                txtNombre.Text            = asistente.nombre;
                txtTelefono.Text          = asistente.telefono;
                txtCorreo.Text            = asistente.correo;
                txtCurp.Text          = asistente.curp;
                txtRFC.Text           = asistente.rfc;
                txtAnticipo.Value     = asistente.pago;
                lblAnticipo.Text      = "Pago: $";
                txtAnticipo.ReadOnly  = true;
                txtCosto.Value        = asistente.costo;
                txtObservaciones.Text = asistente.observaciones;
            }
        }