private void ExecuteDaySelectCommand(object selectedIndex) { int selectedCellIndex = Convert.ToInt32(selectedIndex); WeekDaysView.ToList().ForEach(c => c.IsSelectedCell = false); DateCellViewModel dateCellViewModel = WeekDaysView[selectedCellIndex]; dateCellViewModel.IsSelectedCell = true; SelectedDate = dateCellViewModel.DateValue; LoadSchedulesForSelectedDate(); }
public Calendar() { startDate = DateTime.Today; startDay = DayOfWeek.Sunday; Scope = CalendarScope.Days; MainView = new Stack(); ItemsContainer = new Stack { Id = "ItemsContainer" }; Header = new HeaderView(); Header.PreviousTapped.HandleWith(Header_PreviousTapped); Header.NextTapped.HandleWith(Header_NextTapped); Header.TitleTapped.Handle(() => ChangeScope(nextScope: true)); Days = DaysView.CreateInstance(new CalendarAttributes { StartDate = startDate }); WeekDays = WeekDaysView.CreateInstance(); }
public ActionResult EditWeekDay(int?id) { WeekDayModel model = null; List <TimeModel> times = null; using (IUnitOfWork uow = new UnitOfWork(new DbContextWrap())) { model = _repository.GetByKey <WeekDayModel>(uow, id); times = _repository.GetAll <TimeModel>(uow).ToList(); } var view = new WeekDaysView(model.Id, model.Name) { StartTimeValue = times.Where(x => x.Id == model.StartTime).First().StartTime, EndTimeValue = times.Where(x => x.Id == model.EndTime).First().StartTime, IsCancelled = model.IsCancelled, Times = times }; return(PartialView("_EditWeekDayPartialView", view)); }