コード例 #1
0
 private void cmbentreprise_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cmbentreprise.SelectedIndex > -1)
     {
         cmbentreprisesource.SelectedIndex = cmbentreprise.SelectedIndex;
         string sql = "SELECT fact_entreprise.*, typetva.taux as tauxtva, typetva.idtva FROM fact_entreprise LEFT JOIN typetva ON typetva.idtva = fact_entreprise.idtauxtva where identreprise =" + cmbentreprisesource.SelectedValue.ToString();
         DeltaSQLCon.CommandText = sql;
         MySqlDataReader mr = DeltaSQLCon.ExecuteReader();
         if (mr.Read())
         {
             identreprisesel = cmbentreprisesource.SelectedValue.ToString();
             decimal.TryParse(Util.GetValue(mr, "tauxtva"), out dtvachf);
             int.TryParse(Util.GetValue(mr, "echeance"), out iecheance);
             nombasecompta = Util.GetValue(mr, "basededonnees");
             comptedebit   = Util.GetValue(mr, "comptedebit");
             compteb       = Util.GetValue(mr, "compteb");
             comptefacture = Util.GetValue(mr, "comptefacture");
         }
         mr.Close();
     }
 }