public void OffsetAllWorkScheduleItems(WorkScheduleItem changedItem) { TimeSpan ts = changedItem.From - changedItem.OriginalStartDate; Enums.Enumerations.Department dept = (Enums.Enumerations.Department)Enum.Parse(typeof(Enums.Enumerations.Department), changedItem.Department.DepartmentName); var siblings = TempDragItems.Where( tdi => tdi.JobScheduleId == changedItem.JobScheduleId && ((Enums.Enumerations.Department)Enum.Parse(typeof(Enums.Enumerations.Department), tdi.Department.DepartmentName)) > dept); siblings?.ForEach(wi => { if (wi != changedItem) { wi.From += ts; } }); }
public void ResetWorkItemTimesForMonthView() { WorkItems.Clear(); TempDragItems.ForEach(wi => { WorkScheduleItem temp = new WorkScheduleItem { Id = wi.Id, Color = wi.Color, Department = wi.Department, From = wi.From, To = wi.From + (wi.OriginalEndDate - wi.OriginalStartDate), ItemName = wi.ItemName, FromTime = wi.FromTime, ToTime = wi.ToTime, Description = wi.Description, IsAllDay = wi.IsAllDay, EstimatedBoardFeet = wi.EstimatedBoardFeet }; WorkItems.Add(temp); }); }
public void SetEndTimesForWeekView() { TempDragItems.Clear(); WorkItems.ForEach(wi => { WorkScheduleItem temp = new WorkScheduleItem { Id = wi.Id, Color = wi.Color, Department = wi.Department, From = wi.From, To = wi.From.AddHours(2), ItemName = wi.ItemName, FromTime = wi.FromTime, ToTime = wi.ToTime, Description = wi.Description, IsAllDay = wi.IsAllDay, OriginalStartDate = wi.From, OriginalEndDate = wi.To, EstimatedBoardFeet = wi.EstimatedBoardFeet }; TempDragItems.Add(temp); }); }