public WorkTimeRangeDto(WorkTimeRange timeRange) { Id = timeRange.Id; Start = timeRange.Start; End = timeRange.End; WorkTaskId = timeRange.WorkTaskId; }
private void UpdateWorkTimeRanges() { var DBRanges = new List <WorkTimeRange>(); foreach (var rng in WorkTimeRanges) { WorkTimeRange workRng = new WorkTimeRange() { WorkID = WorkVM.Work.ID, StartTime = rng.StartTime, EndTime = rng.EndTime, ID = rng.ID }; DBRanges.Add(workRng); } WorksVM.UpdateTimeRanges(DBRanges, Work.ID); }
public void Run(Context ctx, string[] args) { // TODO: Duplicate var start = DateTime.Parse(args[0], CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); var end = DateTime.Parse(args[1], CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); var entity = new WorkTimeRange() { Start = start, End = end, WorkTaskId = int.Parse(args[2]) }; ctx.WorkTimeRanges.Add(entity); ctx.Save(); }
public void Run(Context ctx, string[] args) { var now = DateTime.Now; var start = now.AddHours(-double.Parse(args[0])); var end = now; var entity = new WorkTimeRange() { Start = start, End = end, WorkTaskId = int.Parse(args[1]) }; ctx.WorkTimeRanges.Add(entity); ctx.Save(); }