Ejemplo n.º 1
0
        void UpdateStatus(AppoimantsStatus_SP status)
        {
            AppointmentList appList = new AppointmentList();

            SelectedTimespamView.Appointment.Status = (int)status;

            if (status.Equals(AppoimantsStatus_SP.Cancelado))
            {
                if (SelectedTimespamView.Appointment.IsExceptional)
                {
                    appList.Add(SelectedTimespamView.Appointment);

                    ServiceCalls.RemoveAppoiment(SelectedTimespamView.Appointment.AppointmentId);

                    OnChangeStatus(status);
                    Refresh();
                    return;
                }
            }
            //    AppointmentBE app =  SelectedTimespamView.Appointment.Clone<AppointmentBE>();
            //    app.Subject = string.Concat(Enum.GetName(typeof(AppoimantsStatus_SP),status), " a las : ", SelectedTimespamView.Appointment.TimeEnd);
            //    app.Status = (int)status;
            //    appList.Add(app);

            //    try
            //    {
            //        Controller.CreateAppointments(app);

            //        if (OnCreateAppoimentsEvent != null)
            //            OnCreateAppoimentsEvent(app, new EventArgs());


            //    }

            //    catch (Exception ex)
            //    {
            //        this.ExceptionViewer.Show(ex);
            //    }

            //}

            try
            {
                appList.Add(SelectedTimespamView.Appointment);

                ServiceCalls.UpdateAppoiment(appList);

                OnChangeStatus(status);
                Refresh();
            }
            catch (Exception ex)
            {
                this.ExceptionViewer.Show(ex);
            }
        }