예제 #1
0
        private void AssociatedObject_AppointmentCreating(object sender, AppointmentCreatingEventArgs e)
        {
            e.Cancel = true;
            var newAppointment = e.Appointment.Copy();

            newAppointment.End = e.Appointment.Start.AddHours(1);
            var collection = (AssociatedObject.AppointmentsSource as IList);

            if (collection == null && AssociatedObject.AppointmentsSource is ICollectionView)
            {
                collection = (AssociatedObject.AppointmentsSource as ICollectionView).SourceCollection as IList;
            }
            if (collection != null)
            {
                collection.Add(newAppointment);
            }
        }
예제 #2
0
 public void SchedulerClosedDaysCreating(object sender, AppointmentCreatingEventArgs e)
 {
     AppClosedDay newAppointment = ((AppClosedDay)e.Appointment);
     newAppointment.IsNew = true;
     newAppointment.Start = DateEx.GetStartOfDay(newAppointment.Start);
     newAppointment.End = DateEx.GetEndOfDay(newAppointment.Start);
     newAppointment.IsAllDayEvent = true;
 }
예제 #3
0
 public void SchedulerAppointmentCreating(object sender, AppointmentCreatingEventArgs e)
 {
     AppAppointment newAppointment = ((AppAppointment)e.Appointment);
     newAppointment.UserId = (int)Session.SessionInfo.Instance.CurrentUser.UserId;
     newAppointment.IsNew = true;
 }
예제 #4
0
 private void AssociatedObject_AppointmentCreating(object sender, AppointmentCreatingEventArgs e)
 {
     e.Cancel = !AllowCreating;
 }
 private void OnAppointmentCreating(object sender, AppointmentCreatingEventArgs e)
 {
     (e.Appointment as CommonModel).Parent = this.ViewModel.Tasks[0].Children[0];
 }
예제 #6
0
 private void ScheduleViewOnAppointmentCreating(object sender, AppointmentCreatingEventArgs e)
 {
     e.Cancel = true;
 }
예제 #7
0
        private void AppointmentCreatingCommandExecute(AppointmentCreatingEventArgs appointmentCreatingEventArgs)
        {
            appointmentCreatingEventArgs.Cancel = true;

            _appointmentMenuView = _appointmentMenuView ??
                                   new AppointmentMenuView(
                                       () => CreateOrder(_scheduler.SelectedTimeSlot.Start,
                                                         _scheduler.SelectedTimeSlot.End),
                                       () =>
                                           {
                                               CreateClientAndOrder(_scheduler.SelectedTimeSlot.Start,
                                                                    _scheduler.SelectedTimeSlot.End);

                                               UpdateClients();
                                               UpdateOrders();
                                           });

            _appointmentMenuView.Visibility = Visibility.Collapsed;
            _appointmentMenuView.Show();

            _appointmentMenuView.SetValue(Canvas.TopProperty, _positionCursor.Y + deltaY);
            _appointmentMenuView.SetValue(Canvas.LeftProperty,_positionCursor.X + deltaX);

            _appointmentMenuView.Visibility = Visibility.Visible;

//            CreateOrder(_scheduler.SelectedTimeSlot.Start, _scheduler.SelectedTimeSlot.End);
        }
예제 #8
0
        void Scheduler_AppointmentCreating(object sender, AppointmentCreatingEventArgs e)
        {
            if (WebContext.Current.User.IsAuthenticated)
            {
                var app = new Appointment();
                app.CopyFrom(e.Appointment);
                e.Cancel = true;
                domainContext.Load<UserTeam>(domainContext.GetTeamByNameQuery(WebContext.Current.User.Name)).Completed += (s, a) =>
                    {
                        domainContext.Load<MeetingScheduler.Web.Resource>(domainContext.GeResourceByIDQuery(domainContext.UserTeams.ElementAt(0).Team)).Completed += (sen, args) =>
                            {

                                LoadOperation loadOp = sen as LoadOperation;
                                var res = loadOp.Entities.ElementAt(0) as MeetingScheduler.Web.Resource;

                                Telerik.Windows.Controls.Resource resource = new Telerik.Windows.Controls.Resource();
                                resource.ResourceName = res.Name;
                                resource.DisplayName = res.DisplayName;
                                resource.ResourceType = res.ResourceTypes.Name;
                                app.Resources.Add(resource);

                                resource = new Telerik.Windows.Controls.Resource();
                                resource.ResourceName = (SelectResource.SelectedValue as RadComboBoxItem).Content.ToString();
                                resource.DisplayName = (SelectResource.SelectedValue as RadComboBoxItem).Content.ToString();
                                resource.ResourceType = "Room";

                                app.Resources.Add(resource);
                                app.TimeMarker = new TimeMarker();

                                Scheduler_AppointmentCreated(app);

                                RadScheduleViewCommands.EditAppointment.Execute(app, Scheduler);
                            };
                    };
            }
            else
            {
                e.Cancel = true;
                MessageBox.Show("PLease login and try again");
            }
        }