protected WaterTabViewModel() { CurrentDate = Resources.todayLabel + DateTime.Today.ToString("d"); DailyTotalWaterCapacity = WaterRepository.Instance.GetByDay(DateTime.Today).TotalCapacity; DayWaterCapacity = WaterRepository.Instance.GetByDay(DateTime.Today).DailyWaterOperations; NewWaterOperation = new OnceDrink(); NewWaterOperation.Capasity = 0.1; SetLastDrincOperationTimer(); SetNotificationTimer(); UpdateWaterPercent(); }
public void ExecuteAddNewWaterOperationCommand(object parametr) { NewWaterOperation.Time = DateTime.Now; DayWaterCapacity.Add(new OnceDrink() { Capasity = NewWaterOperation.Capasity, Time = NewWaterOperation.Time }); DailyTotalWaterCapacity += NewWaterOperation.Capasity; WaterRepository.Instance.AddOperation(NewWaterOperation); NewWaterOperation = new OnceDrink(); NewWaterOperation.Capasity = 0.1; UpdateWaterPercent(); RefreshNotification(); }