Esempio n. 1
0
 private void btnGenerarReportePagos_Click(object sender, EventArgs e)
 {
     if (LBLCODIGOALUMN.Text != "" && label7.Text != "" && label5.Text != "")
     {
         DataTable tabledata = CARGARLISTADEPAGOS(label5.Text);
         DataTable dtalumno  = new DataTable();
         try
         {
             SqlCommand comando = new SqlCommand("small_buscar_pordni", _SqlConnection);
             comando.CommandType = CommandType.StoredProcedure;
             if (comando.Connection.State == ConnectionState.Closed)
             {
                 comando.Connection.Open();
             }
             comando.Parameters.Add(new SqlParameter("@dni", label7.Text));
             SqlDataAdapter da = new SqlDataAdapter(comando);
             da.Fill(dtalumno);
             if (comando.Connection.State == ConnectionState.Open)
             {
                 comando.Connection.Close();
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
         dtLegend.Clear();
         //List<string> ListaSaldos = new List<string>();
         string simbolo = "*";
         tabledata.Columns.Add("simbolo");
         tabledata.Columns.Add("fecha");
         foreach (DataRow item in tabledata.Rows)
         {
             if (item["fech"].ToString() == "")
             {
                 buscarRecibosLeyenda(item[0].ToString(), simbolo);
                 item["simbolo"] = simbolo;
                 simbolo         = simbolo + "*";
             }
             else
             {
                 string fecha = Convert.ToDateTime(item["fech"]).ToString("dd/MM/yyyy");
                 item["fecha"] = fecha;
             }
         }
         DataTable dtSaldo = buscarSaldo();
         dtSaldo.Columns["numero_recibo"].ColumnName = "nro_recibo";
         using (frmRptListaDePagos frm = new frmRptListaDePagos(tabledata, dtalumno, usuario, dtLegend, dtSaldo))
         {
             frm.ShowDialog();
         }
     }
     else
     {
         MessageBox.Show("Selecciona un alumno");
     }
 }
Esempio n. 2
0
 private void btnGenerarReportePagos_Click(object sender, EventArgs e)
 {
     if (LBLCODIGOALUMN.Text != "" && label7.Text != "" && label5.Text != "")
     {
         DataTable tabledata = CARGARLISTADEPAGOS(label5.Text);
         DataTable dtalumno  = new DataTable();
         try
         {
             SqlCommand comando = new SqlCommand("small_buscar_pordni", _SqlConnection);
             comando.CommandType = CommandType.StoredProcedure;
             if (comando.Connection.State == ConnectionState.Closed)
             {
                 comando.Connection.Open();
             }
             comando.Parameters.Add(new SqlParameter("@dni", label7.Text));
             SqlDataAdapter da = new SqlDataAdapter(comando);
             da.Fill(dtalumno);
             if (comando.Connection.State == ConnectionState.Open)
             {
                 comando.Connection.Close();
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
         using (frmRptListaDePagos frm = new frmRptListaDePagos(tabledata, dtalumno))
         {
             frm.ShowDialog();
         }
     }
     else
     {
         MessageBox.Show("Porfavor asegurate de buscar un alumno primero");
     }
 }