Dans un champ texte , ça fonctionne avec ça :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 DateTime startD = Convert.ToDateTime(doc.GetStringValue( "IS_DateOuv" )); int numVal = Int32.Parse(doc.GetStringValue( "ACPA_CriticiteAbbr" )); double businessDays = numVal; int DoW = (int)startD.DayOfWeek; double temp = businessDays + DoW + 1; if (DoW != 0) temp --; DateTime calcendD = startD.AddDays(Math.Floor(temp / 5)*2-DoW + temp- 2* Convert.ToInt32(temp % 5 == 0)) ; returnValue = Convert.ToString(calcendD);
Sur un champ date , ça fonctionne pas
J'ai essayé la conversion suivante:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 DateTime startD = Convert.ToDateTime(doc.GetStringValue( "IS_DateOuv" )); int numVal = Int32.Parse(doc.GetStringValue( "ACPA_CriticiteAbbr" )); double businessDays = numVal; int DoW = (int)startD.DayOfWeek; double temp = businessDays + DoW + 1; if (DoW != 0) temp --; DateTime calcendD = startD.AddDays(Math.Floor(temp / 5)*2-DoW + temp- 2* Convert.ToInt32(temp % 5 == 0)) ; returnValue = Convert.ToDateTime(calcendD));
Comment faut-il faire la conversion pour alimenter mon champ date calculé ?
Merci d'avance de votre retour.
Partager