Example #1
0
        private async void Calendar_DateClicked(object sender, XamForms.Controls.DateTimeEventArgs e)
        {
            lbl.Text = calendar.SelectedDate.Value.ToShortDateString();
            bool         datePresent  = false;
            CalendarList calendarList = null;

            foreach (CalendarList cl in mvm.CalendarLists)
            {
                if (cl.Date == calendar.SelectedDate.Value)
                {
                    datePresent  = true;
                    calendarList = cl;
                    break;
                }
            }
            if (!datePresent)
            {
                calendarList = new CalendarList {
                    Date = calendar.SelectedDate.Value, Tasks = new ObservableCollection <TaskViewModel>()
                };
                mvm.CalendarLists.Add(calendarList);
            }
            await Navigation.PushAsync(new TasksListPage(calendarList.Tasks));

            //await Navigation.PushAsync(new TasksListPage(calendar.SelectedDate.Value));
        }
        async void Handle_DateClicked(object sender, XamForms.Controls.DateTimeEventArgs e)
        {
            ResetLayout();
            if (calendar.SelectedDate < DateTime.Now)
            {
                timeSlotGrid.IsVisible = false;
            }
            else
            {
                timeSlotGrid.IsVisible = true;
                selectedDate           = calendar.SelectedDate.Value.Year + "-" + calendar.SelectedDate.Value.Month + "-" + calendar.SelectedDate.Value.Day;

                var result = await service.FacilityScreen(App.Current.Properties["defaultPid"].ToString(), facilityId, selectedDate);

                if (result != null)
                {
                    if (result.status_code == System.Net.HttpStatusCode.OK)
                    {
                        int i = 0;

                        if (result.availableBookingTimeSlotList != null)
                        {
                            availableSlots = result.availableBookingTimeSlotList;
                        }
                        foreach (var item in availableSlots)
                        {
                            var button = new BookingButton {
                                Text = item.startTime + " - " + item.endTime, StyleId = item.tId
                            };
                            buttonArray.Add(item.tId, button);
                            button.Clicked += Button_Clicked;
                            timeSlotGrid.Children.Add(button, i % 4, i / 4);
                            i++;
                        }
                    }
                    else if (result.status_code == System.Net.HttpStatusCode.BadRequest)
                    {
                        await DisplayAlert("Error", "Facility booking setup is incomplete", "OK");

                        await Navigation.PopAsync(true);
                    }
                }
            }
        }
Example #3
0
 private void calendar_DateClicked(object sender, XamForms.Controls.DateTimeEventArgs e)
 {
     if (calendar.SelectedDate != null)
     {
         var    tempObj = calendar.SelectedDate;
         string events  = "";
         foreach (ProjTask item in tasks.Where(i => i.StartDate == $"{tempObj.Value.Day}.{tempObj.Value.Month}.{tempObj.Value.Year}"))
         {
             events += $" {item.IDinProject}. {item.Name}  - Start date\n";
         }
         foreach (ProjTask item in tasks.Where(i => i.EndDate == $"{tempObj.Value.Day}.{tempObj.Value.Month}.{tempObj.Value.Year}"))
         {
             events += $" {item.IDinProject}. {item.Name}  - End date\n";
         }
         if (events.Equals("").Equals(false))
         {
             DisplayAlert($"{tempObj.Value.Day}.{tempObj.Value.Month}.{tempObj.Value.Year}", events, "Cancel");
         }
     }
 }
Example #4
0
 private void calender_DateClicked(object sender, XamForms.Controls.DateTimeEventArgs e)
 {
     Navigation.PushAsync(new DaytasksPageView(dayTasksViewModel.CurrentSelectedDate.ToString("yyyy-MM-dd")));
 }
Example #5
0
 private async void calender_DateClicked(object sender, XamForms.Controls.DateTimeEventArgs e)
 {
     //todo
     await DisplayAlert("Current date", "" + calender.SelectedDate, "cancel");
 }
Example #6
0
 private async void Calendar_DateClicked(object sender, XamForms.Controls.DateTimeEventArgs e)
 {
     await Application.Current.MainPage.Navigation.PushAsync(new Tagesansicht());
 }
Example #7
0
        async void Handle_DateClicked(object sender, XamForms.Controls.DateTimeEventArgs e)
        {
            selectedDate = calendar.SelectedDate.Value.Year + "-" + calendar.SelectedDate.Value.Month + "-" + calendar.SelectedDate.Value.Day;
            ResetLayout();

            var result = await service.FacilityScreen(App.Current.Properties["defaultPid"].ToString(), facilityId, parent.selectedUnit.unitId, parent.selectedTenant.tenantId, selectedDate);

            if (result != null)
            {
                if (result.status_code == System.Net.HttpStatusCode.OK)
                {
                    timeSelector.Text      = "Select all slots you would like to book";
                    timeSlotGrid.IsVisible = true;
                    int i = 0;

                    if (result.availableBookingTimeSlotList != null)
                    {
                        availableSlots = result.availableBookingTimeSlotList;
                    }
                    if (result.reservedBookingTimeSlotList != null)
                    {
                        reservedSlots = result.reservedBookingTimeSlotList;
                    }

                    foreach (var item in availableSlots)
                    {
                        var button = new BookingButton {
                            Text = item.startTime + " - " + item.endTime, StyleId = item.tId
                        };
                        buttonArray.Add(item.tId, button);
                        button.Clicked += Button_Clicked;
                        timeSlotGrid.Children.Add(button, i % 4, i / 4);
                        i++;
                    }
                    int j = 0;

                    if (result.reservedBookingTimeSlotList != null)
                    {
                        if (result.reservedBookingTimeSlotList.Count > 0)
                        {
                            showAllButton.IsVisible = true;

                            foreach (var item in result.reservedBookingTimeSlotList)
                            {
                                var button = new BookingButton {
                                    Text = item.startTime + " - " + item.endTime, StyleId = item.tId
                                };
                                nonAvailableButtonArray.Add(item.tId, button);
                                unavailableSlotGrid.Children.Add(button, j % 4, j / 4);
                                j++;
                            }
                        }
                    }
                    else
                    {
                        showAllButton.IsVisible = false;
                        notifyFrame.IsVisible   = false;
                    }
                    depositFee = result.deposit;
                }
                else if (result.status_code == System.Net.HttpStatusCode.BadRequest)
                {
                    await DisplayAlert("Error", "Facility booking setup is incomplete", "OK");

                    await Navigation.PopAsync(true);
                }
            }
        }
Example #8
0
 private void Kalendarz_DateClicked(object sender, XamForms.Controls.DateTimeEventArgs e)
 {
 }