Asked by:
PSI and TimeSheet

Question
-
Hi,
I would update the time line of the timesheet. With this code I send the update to Project Server, everything goes well but nothing changes in my timesheet.
Could you help me?Thank you.
/// <summary> /// Permet de mettre à jour la feuille de temps avec une liste de ligne /// </summary> /// <param name="p">Identifiant unique de la feuille de temps</param> /// <param name="liste">Liste des ligne a mettre a jour</param> public void UpdateTimeSheet(string p, List<Line> liste) { // Création d'un identifiant pour le travail a faire en asynchrone sur le serveur Guid jobUID = Guid.NewGuid(); // Récupération de la feuille de temps (objet PSI) SvcTimeSheet.TimesheetDataSet timeSheetDS = _TimeSheetClient.ReadTimesheet(new Guid(p)); // Parcour chaque ligne foreach (Line l in liste) { // Parcour chaque jour de chaque ligne foreach (Work w in l.Works) { try { var data = timeSheetDS.Actuals.FindByTS_LINE_UIDTS_ACT_START_DATE(new Guid(l.Guid), w.Day); if (data != null) { if (data.TS_ACT_VALUE != w.Actual) { data.BeginEdit(); data.TS_ACT_VALUE = w.Actual; data.EndEdit(); } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } } // Envois la feuille de temps sur le serveur pour mise action jour _TimeSheetClient.QueueUpdateTimesheet(jobUID, new Guid(p), timeSheetDS); }
mon blog : http://choulant.blogspot.comSaturday, November 20, 2010 8:50 AM
All replies
-
Noham please check out this code sample I wrote for PS 2007 that should still work for 2010: http://epmtsst.codeplex.com/
Are you running single entry mode?
Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
Project Server TechCenter | Project Developer Center | Project Server Help | Project Product PageWednesday, November 24, 2010 2:30 AM -
Ok, for your code, I look this code but I don't see a code for update time.
-> Are you running single entry mode? Yes !
Thank you
mon blog : http://choulant.blogspot.comWednesday, November 24, 2010 10:26 AM -
Ok Christophe, I've find!!
Thank you,
mon blog : http://choulant.blogspot.comWednesday, November 24, 2010 3:37 PM -
but, it's not good with single entry mode
have you a idea ?
mon blog : http://choulant.blogspot.comWednesday, November 24, 2010 3:41 PM -
Please email me with your code and will ask internally!
Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
Project Server TechCenter | Project Developer Center | Project Server Help | Project Product PageWednesday, November 24, 2010 11:31 PM