1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| private void NumeroVente()
{
//attribution d'un numéro de vente
DataRow[] drJourneeVente = FrmFonctionPrincipale.JourneeVente(DateTime.Today.ToShortDateString());
int iNumero = 0;
string sDate= "";
if(drJourneeVente.Length>0)
{
for(int i=0;i<drJourneeVente.Length;i++)
{
iNumero = Convert.ToInt32(drJourneeVente[i]["NUMERO_VENTE_JOURNEE"]);
sDate = drJourneeVente[i]["DATE_VENTE_JOURNEE"].ToString();
}
}
else
{
sDate = DateTime.Now.ToShortDateString();
iNumero = 1;
}
//je inverser la date
string sDateJour = sDate.Substring(6,4);
sDateJour = sDateJour + sDate.Substring(3,2);
sDateJour = sDateJour + sDate.Substring(0,2);
//-------------------//
sNumero = iNumero.ToString(); |