コード例 #1
0
        async private void saveAppointment(AppointmentEditorClosedEventArgs e)
        {
            if (e.EditedAppointment != null && e.Action == Syncfusion.UI.Xaml.Schedule.EditorClosedAction.Save)
            {
                MappedAppointment appt = e.EditedAppointment as MappedAppointment;

                if (e.IsNew)
                {
                    ServiceLayer s = new ServiceLayer();
                    ServiceLayer.CalendarData = new DTO_CalendarData
                    {
                        AppointmentTypeID = Int32.Parse(appt.MappedSubject),
                        EmployeeID        = ServiceLayer.LoggedInEmployee.EmployeeID,
                        StartTime         = appt.MappedStartTime,
                        EndTime           = appt.MappedEndTime,
                        Note = appt.MappedNote
                    };

                    /// FIX THIS!!!!!!!!~!
                    //await new ServiceLayer().AddCalendarData(ServiceLayer.CalendarData);
                    await new ServiceLayer().AddCalendarData(ServiceLayer.CalendarData);

                    if (ServiceLayer.CalendarData.SuccessFlag)
                    {
                    }
                    else
                    {
                    }
                }
                else if (!e.OriginalAppointment.Equals(e.EditedAppointment))
                {
                    MappedAppointment original = e.OriginalAppointment as MappedAppointment;

                    appt.CalendarDataID = original.CalendarDataID;
                    appt.LeadID         = original.LeadID;


                    ServiceLayer s = new ServiceLayer();
                    ServiceLayer.CalendarData           = ServiceLayer.CalendarDataList.Find(c => c.EntryID == appt.CalendarDataID);
                    ServiceLayer.CalendarData.StartTime = appt.MappedStartTime;
                    ServiceLayer.CalendarData.EndTime   = appt.MappedEndTime;
                    ServiceLayer.CalendarData.Note      = appt.MappedNote;

                    await new ServiceLayer().UpdateCalendarData(ServiceLayer.CalendarData);

                    if (ServiceLayer.CalendarData.SuccessFlag)
                    {
                        //MessageBox.Show(s.CalendarData.SuccessFlag.ToString(), "Success", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                    else
                    {
                        //MessageBox.Show(s.CalendarData.SuccessFlag.ToString(), "Failure", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                }
            }
        }
コード例 #2
0
        private async void KalDag_AppointmentEditorClosed(object sender, AppointmentEditorClosedEventArgs e)
        {
            TimeZoneInfo localZone = TimeZoneInfo.Local;
            var          v         = e.EditedAppointment as Meeting;
            string       svar      = await DataSource.AddEvent(Konto, Password, Doman, Konto, "*****@*****.**", v.EventName, v.From.ToLocalTime(), v.To.Date.ToLocalTime(), localZone.Id);

            var dialog = new MessageDialog(svar);
            await dialog.ShowAsync();

            var vv = v;
        }
コード例 #3
0
        private void Schedule_AppointmentEditorClosed(object sender, AppointmentEditorClosedEventArgs e)
        {
            MeetingsDBDataContext scheduleMeetings = new MeetingsDBDataContext();
            Meeting_Table         meeting;


            if (e.Action == EditorClosedAction.Save)
            {
                var editedAppointment = (e.EditedAppointment as ScheduleMeeting);
                var appointmentID     = Convert.ToInt32(editedAppointment.AppointmentID);

                if (!e.IsNew)
                {
                    meeting = (from data in scheduleMeetings.Meeting_Tables
                               where data.ID == appointmentID
                               select data).First() as Meeting_Table;

                    meeting.Subject   = editedAppointment.MappedSubject;
                    meeting.StartTime = editedAppointment.MappedStartTime.ToString();
                    meeting.EndTime   = editedAppointment.MappedEndTime.ToString();
                    meeting.Color     = editedAppointment.MappedColor.ToString();
                    meeting.IsAllDay  = editedAppointment.MappedIsAllDay.ToString();
                    meeting.ID        = appointmentID;
                }
                else
                {
                    meeting = new Meeting_Table();

                    meeting.Subject   = editedAppointment.MappedSubject;
                    meeting.StartTime = editedAppointment.MappedStartTime.ToString();
                    meeting.EndTime   = editedAppointment.MappedEndTime.ToString();
                    meeting.Color     = editedAppointment.MappedColor.ToString();
                    meeting.IsAllDay  = editedAppointment.MappedIsAllDay.ToString();
                    meeting.ID        = appointmentID;

                    scheduleMeetings.Meeting_Tables.InsertOnSubmit(meeting);
                }
                scheduleMeetings.SubmitChanges();
            }

            if (e.Action == EditorClosedAction.Delete)
            {
                var editedAppointment = (e.OriginalAppointment as ScheduleMeeting);
                var appointmentID     = Convert.ToInt32(editedAppointment.AppointmentID);

                meeting = (from data in scheduleMeetings.Meeting_Tables
                           where data.ID == appointmentID
                           select data).First() as Meeting_Table;

                scheduleMeetings.Meeting_Tables.DeleteOnSubmit(meeting);
                scheduleMeetings.SubmitChanges();
            }
        }
コード例 #4
0
 void Schedule1_AppointmentEditorClosed(object sender, AppointmentEditorClosedEventArgs e)
 {
     ViewSelection.Visibility = Windows.UI.Xaml.Visibility.Visible;
 }
コード例 #5
0
 public void EditorClosed(AppointmentEditorClosedEventArgs arg)
 {
 }
コード例 #6
0
 public void EditorClosed(AppointmentEditorClosedEventArgs arg)
 {
     arg.Handled = true;
     MessageBox.Show("Triggered from VM and editor Closed was Triggered");
 }
コード例 #7
0
 //void MainPage_Loaded(object sender, RoutedEventArgs e)
 //{
 //    dayellipse = ((VisualTreeHelper.GetChild(Day, 0) as StackPanel).Children[0] as Grid).Children[0] as Ellipse;
 //    daytext = (VisualTreeHelper.GetChild(Day, 0) as StackPanel).Children[1] as TextBlock;
 //    daytext.Foreground = new SolidColorBrush(Colors.White);
 //    dayellipse.Stroke = new SolidColorBrush(Colors.White);
 //    dayellipse.Fill = new SolidColorBrush(Colors.White);
 //    Day.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0x47, 0x4F, 0x52));
 //    weekellipse = ((VisualTreeHelper.GetChild(Week, 0) as StackPanel).Children[0] as Grid).Children[0] as Ellipse;
 //    weekellipse.Stroke = new SolidColorBrush(Colors.White);
 //    weektext = (VisualTreeHelper.GetChild(Week, 0) as StackPanel).Children[1] as TextBlock;
 //    weektext.Foreground = new SolidColorBrush(Colors.White);
 //    workweekellipse = ((VisualTreeHelper.GetChild(WorkWeek, 0) as StackPanel).Children[0] as Grid).Children[0] as Ellipse;
 //    workweekellipse.Stroke = new SolidColorBrush(Colors.White);
 //    workweektext = (VisualTreeHelper.GetChild(WorkWeek, 0) as StackPanel).Children[1] as TextBlock;
 //    workweektext.Foreground = new SolidColorBrush(Colors.White);
 //    monthellipse = ((VisualTreeHelper.GetChild(Month, 0) as StackPanel).Children[0] as Grid).Children[0] as Ellipse;
 //    monthellipse.Stroke = new SolidColorBrush(Colors.White);
 //    monthtext = (VisualTreeHelper.GetChild(Month, 0) as StackPanel).Children[1] as TextBlock;
 //    monthtext.Foreground = new SolidColorBrush(Colors.White);
 //    timelineellipse = ((VisualTreeHelper.GetChild(TimeLine, 0) as StackPanel).Children[0] as Grid).Children[0] as Ellipse;
 //    timelineellipse.Stroke = new SolidColorBrush(Colors.White);
 //    timelinetext = (VisualTreeHelper.GetChild(TimeLine, 0) as StackPanel).Children[1] as TextBlock;
 //    timelinetext.Foreground = new SolidColorBrush(Colors.White);
 //}
 void schedule_AppointmentEditorClosed(object sender, AppointmentEditorClosedEventArgs e)
 {
     //stackpanel.Visibility = Visibility.Visible;
 }