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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
private void CreancePhy_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
int i = CreancePhy.CurrentRow.Index;
ligne = i;
CreancePhy[11, i].Value = " le client a reglé un montant de "+CreancePhy[7,i].Value+"dans la période" +CreancePhy[1,i].Value;
decimal montant = (decimal)this.CreancePhy[7, i].Value;
for (int j = 0; j <= i; j++)
{
if ((((decimal)this.CreancePhy[8, j].Value != 0)) && (((decimal)this.CreancePhy[8, j].Value) <= ((decimal)this.CreancePhy[7, i].Value)))
{
CreancePhy[7, j].Value = (decimal)this.CreancePhy[7, j].Value + (decimal)this.CreancePhy[8, j].Value;
CreancePhy[11, j].Value = CreancePhy[11, j].Value + "réglement a eu lieu en" + CreancePhy[1, i].Value + "d'un montant de" + (decimal)this.CreancePhy[8, j].Value;
CreancePhy[8, j].Value = (decimal)this.CreancePhy[6, j].Value - (decimal)this.CreancePhy[7, j].Value;
CreancePhy[7, i].Value = (decimal)this.CreancePhy[7, i].Value - (decimal)this.CreancePhy[8, j].Value;
for (int k = j + 1; k <= i; k++)
{
CreancePhy[4, k].Value = (decimal)this.CreancePhy[8, k - 1].Value;
CreancePhy[6, k].Value = (decimal)this.CreancePhy[4, k].Value + (decimal)this.CreancePhy[5, k].Value;
CreancePhy[8, k].Value = (decimal)this.CreancePhy[6, k].Value -(decimal)this.CreancePhy[7, k].Value;
}
}
else
{
if ((decimal)this.CreancePhy[8, j].Value != 0)
{
CreancePhy[7, j].Value = (decimal)this.CreancePhy[7, j].Value + (decimal)this.CreancePhy[7, i].Value;
CreancePhy[11, j].Value = CreancePhy[11, j].Value + "réglement a eu lieu en" + CreancePhy[1, i].Value + "d'un montant de" + (decimal)this.CreancePhy[7, i].Value;
CreancePhy[8, j].Value = (decimal)this.CreancePhy[6, j].Value - (decimal)this.CreancePhy[7, j].Value;
CreancePhy[7, i].Value = 0;
for (int k = j + 1; k <= i; k++)
{
CreancePhy[4, k].Value = (decimal)this.CreancePhy[8, k - 1].Value;
CreancePhy[6, k].Value = (decimal)this.CreancePhy[4, k].Value + (decimal)this.CreancePhy[5, k].Value;
CreancePhy[8, k].Value = (decimal)this.CreancePhy[6, k].Value - (decimal)this.CreancePhy[7, k].Value;
}
}
}
}
} |
Partager