示例#1
0
 public void UpdateTimesheet(Models.Timesheet.Timesheet timesheetVm)
 {
     foreach (var timeEntryVm in timesheetVm.TimeEntries)
     {
         if (timeEntryVm.EntryId == 0)
         {
             _tsManager.AddTimeEntry(timesheetVm.TimesheetId, timeEntryVm.ProjectId, timeEntryVm.WorkTypeId, BuildDailyTime(timeEntryVm));
         }
         else
         {
             _tsManager.UpdateTimeEntry(timeEntryVm.EntryId, timeEntryVm.ProjectId, timeEntryVm.WorkTypeId, BuildDailyTime(timeEntryVm));
         }
     }
 }