Пример #1
0
 private async void EditorLayout_AppointmentModified(object sender, ViewModels.ScheduleAppointmentModifiedEventArgs e)
 {
     editorLayout.IsVisible = false;
     if (e.IsModified)
     {
         if (CommonVariables.localDatabase)
         {
             if (isNewAppointment)
             {
                 (schedule.DataSource as ObservableCollection <Model.Meeting>).Add(e.Appointment);
             }
             else
             {
                 (schedule.DataSource as ObservableCollection <Model.Meeting>).RemoveAt(indexOfAppointment);
                 (schedule.DataSource as ObservableCollection <Model.Meeting>).Insert(indexOfAppointment, e.Appointment);
             }
         }
         else
         {
             schedule.DataSource = await CommonVariables.GetSettings();
         }
     }
 }
        private async void InitializeDataForBookings()
        {
            ListOfMeeting = await CommonVariables.GetSettings();

            /*List<Todo> meeting_list = await App.Database.GetItemsAsync();
             * foreach (var item in meeting_list)
             * {
             *  Meeting it = new Meeting
             *  {
             *      id = item.id,
             *      ContactID = item.ContactID,
             *      Description = item.Description,
             *      Done = item.Done,
             *      EndTimeZone = item.EndTimeZone,
             *      StartTimeZone = item.StartTimeZone,
             *      EventName = item.EventName,
             *      From = item.From,
             *      FromDate = item.FromDate,
             *      To = item.To,
             *      ToDate = item.ToDate,
             *      IsAllDay = item.IsAllDay,
             *      MinimumHeight = item.MinimumHeight,
             *      PostCode = item.PostCode,
             *      responsible = item.responsible,
             *      type = item.type,
             *
             *
             *  };
             *  ListOfMeeting.Add(it);
             * }*/


            //for test job type
            foreach (var item in ListOfMeeting)
            {
                Debug.WriteLine(item.PostCode);
                Debug.WriteLine(item.From);
                Debug.WriteLine(item.To);
            }

            /*
             *
             * DateTime minDate;
             * DateTime minDateFrom = DateTime.Now.AddDays(-2);
             * DateTime minDateTo = DateTime.Now.AddDays(2);
             * ListOfMeeting.Add(
             * new Model.Meeting()
             * {
             *  EventName = "Lee",
             *  PostCode = "Lee",
             *  ContactID = "Lee",
             *  Description = "ghh",
             *  From = new DateTime(DateTime.Now.AddDays(-2).Year, DateTime.Now.AddDays(-2).Month, DateTime.Now.AddDays(-2).Day, new Random().Next(9, 18), 30, 0),
             *  To = new DateTime(DateTime.Now.AddDays(-2).Year, DateTime.Now.AddDays(-2).Month, DateTime.Now.AddDays(-2).Day, new Random().Next(9, 18), 30, 0),
             *  StartTimeZone = string.Empty,
             *  EndTimeZone = string.Empty,
             *  MinimumHeight = height,
             *  IsAllDay = true,
             *  Done = false,
             *  type = "Job",
             *  responsible = "Other",
             * });*/


            currentDayMeetings = new List <string>();
            currentDayMeetings.Add("Job");
            currentDayMeetings.Add("Sales");
            currentDayMeetings.Add("Maintenance");


            // MinimumHeight Appointment Subjects
            minTimeMeetings = new List <string>();
            minTimeMeetings.Add("Work log alert");
            minTimeMeetings.Add("Birthday wish alert");
            minTimeMeetings.Add("Task due date");
            minTimeMeetings.Add("Status mail");
            minTimeMeetings.Add("Start sprint alert");

            color_collection = new List <Color>();
            color_collection.Add(Color.FromHex("#FF339933"));
            color_collection.Add(Color.FromHex("#FF00ABA9"));
            color_collection.Add(Color.FromHex("#FFE671B8"));
            color_collection.Add(Color.FromHex("#FF1BA1E2"));
            color_collection.Add(Color.FromHex("#FFD80073"));
            color_collection.Add(Color.FromHex("#FFA2C139"));
            color_collection.Add(Color.FromHex("#FFA2C139"));
            color_collection.Add(Color.FromHex("#FFD80073"));
            color_collection.Add(Color.FromHex("#FF339933"));
            color_collection.Add(Color.FromHex("#FFE671B8"));
            color_collection.Add(Color.FromHex("#FF00ABA9"));
        }