public void Update() { ListOrders.Clear(); foreach (var item in _storage.Orders) { ListOrders.Add(_storage.GetOrder(item.OrderNumer)); } MinTime = !ListPosts.Any() ? 8 : ListPosts.Min(o => o.TimeFrom).Hours; MaxTime = !ListPosts.Any() ? 18 : (int)Math.Ceiling(ListPosts.Max(o => o.TimeTo).TotalHours); Columns.Clear(); for (var i = MinTime; i < MaxTime; i++) { Columns.Add(Date + new TimeSpan(i, 0, 0)); Columns.Add(Date + new TimeSpan(i, 30, 0)); } Columns.Add(Date + new TimeSpan(MaxTime, 0, 0)); }
private CarOrderPostModel GetOrder(int indx) { //TODO Get Order from db return(_storage.GetOrder(indx)); }