Example #1
0
 private void btnGrabar_Click(object sender, EventArgs e)
 {
     if (ValidaDatos())
     {
         string    cNombres           = txtcNombres.Text;
         string    cApellidos         = txtcApellidoPat.Text + " " + txtcApellidoMat.Text;
         string    cDocumento         = txtcDocumento.Text;
         decimal   nMontoApuesta      = Convert.ToDecimal(txtnMontoApuesta.Text);
         int       nAnotacionesLocal  = Convert.ToInt32(txtnAnotacionLocal.Text);
         int       nAnotacionesVisita = Convert.ToInt32(txtnAnotacionVisita.Text);
         DateTime  dFechaReg          = DateTime.Today;
         int       idUsuarioReg       = 1;
         DataTable dtRes = new clsApuestas().ADRegistraApuesta(idConfiguraciones, cNombres, cApellidos,
                                                               cDocumento, nMontoApuesta, nAnotacionesLocal,
                                                               nAnotacionesVisita, dFechaReg, idUsuarioReg);
         if (dtRes.Rows.Count > 0)
         {
             if (Convert.ToInt32(dtRes.Rows[0][0]) == 0)
             {
                 txtCodRecibo.Text = dtRes.Rows[0]["idRecibo"].ToString();
                 Voucher(dtRes);
                 HabilitaLimpiaControles(true, 3);
             }
         }
     }
 }
Example #2
0
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            if (ValidaDatos())
            {
                string    cNombres           = txtcNombres.Text;
                string    cApellidos         = txtcApellidoPat.Text + " " + txtcApellidoMat.Text;
                string    cDocumento         = txtcDocumento.Text;
                decimal   nMontoApuesta      = Convert.ToDecimal(txtnMontoApuesta.Text);
                int       nAnotacionesLocal  = Convert.ToInt32(txtnAnotacionLocal.Text);
                int       nAnotacionesVisita = Convert.ToInt32(txtnAnotacionVisita.Text);
                DateTime  dFechaReg          = DateTime.Today;
                int       idUsuarioReg       = 1;
                DataTable dtRes = new clsApuestas().ADRegistraApuesta(idConfiguraciones, cNombres, cApellidos,
                                                                      cDocumento, nMontoApuesta, nAnotacionesLocal,
                                                                      nAnotacionesVisita, dFechaReg, idUsuarioReg);
                if (dtRes.Rows.Count > 0)
                {
                    if (Convert.ToInt32(dtRes.Rows[0][0]) == 0)
                    {
                        txtCodRecibo.Text = dtRes.Rows[0]["idRecibo"].ToString();
                        //Voucher(dtRes);
                        #region Imprime
                        int idConcepto      = 1;
                        int idTipoOperacion = 1;
                        int idKardex        = Convert.ToInt32(dtRes.Rows[0]["idKardex"]);
                        int idApuesta       = Convert.ToInt32(dtRes.Rows[0]["idApuesta"]);
                        int idRecibo        = Convert.ToInt32(dtRes.Rows[0]["idRecibo"]);

                        MyMessageBox.Show("Operacion realizada correctamente", "Retiro de caja", MessageBoxButtons.OK, MessageBoxIcon.Information);


                        // impresion del boucher
                        DataTable TB = new AdReportes().CobroApuesta(idApuesta, idKardex);
                        if (TB.Rows.Count > 0)
                        {
                            List <ReportDataSource> dtslist   = new List <ReportDataSource>();
                            List <ReportParameter>  paramlist = new List <ReportParameter>();

                            dtslist.Clear();
                            paramlist.Clear();

                            dtslist.Add(new ReportDataSource("dtsImpresion", TB));

                            paramlist.Add(new ReportParameter("idApuesta", idApuesta.ToString(), false));
                            paramlist.Add(new ReportParameter("idKardex", idKardex.ToString(), false));
                            paramlist.Add(new ReportParameter("idTipoOperacion", idTipoOperacion.ToString(), false));
                            paramlist.Add(new ReportParameter("idConcepto", idConcepto.ToString(), false));

                            string NombreReporte = "RptApuesta.rdlc";
                            new FrmReportador(dtslist, NombreReporte, paramlist).ShowDialog();
                        }
                        #endregion
                        HabilitaLimpiaControles(true, 3);
                    }
                }
            }
        }