예제 #1
0
        /// <summary>
        ///     Cria um novo formulário de compromisso na interface, modificando alguns controles como por exemplo,
        /// a localização do formulário, ícone, etc.
        /// </summary>
        private void ultraCalendarInfo1_BeforeDisplayAppointmentDialog(object sender, DisplayAppointmentDialogEventArgs e)
        {
            //Cancela o criador de 'compromisso' padrão.
            e.Cancel = true;

            //Cria o 'compromisso' personalizado
            FrmNewAppointment app = new FrmNewAppointment(FrmNewAppointment.e_TipoAgendamento.Novo, cbMaquinas.SelectedItem.ToString());

            app.ShowDialog();

            //if (FrmNewAppointment.App != null)
            //{
            //    #region Obsoleto - motivo : adicionava os dados na aba padrão.
            //    //Appointment appt = ultraDayView1.CalendarInfo.Appointments.Add(FrmNewAppointment.App.DtInicio, FrmNewAppointment.App.DtFim, FrmNewAppointment.App.Titulo);
            //    //appt.Description = FrmNewAppointment.App.Descricao;
            //    //appt.Location = "(None)";
            //    //ultraCalendarInfo1.Appointments.Add(appt);
            //    //ultraDayView1.Refresh();
            //    #endregion

            //    // Get the Sample Data required for Appointments and Owners data binding
            //    DataSet ds = ObtemApontamentos_Existentes();

            //    AdicionaNovoApontamento(ref ds);

            //    // Bind ultraCalendarInfo to Appointments Data Table
            //    ultraCalendarInfo1.DataBindingsForAppointments.DataSource = ds.Tables["Appointments"];

            //    // Bind ultraCalendarInfo to Owners Data Table
            //    ultraCalendarInfo1.DataBindingsForOwners.DataSource = ds.Tables["Owners"];

            //    // Set Appointments data binding properties to UltraCalendarInfo
            //    ultraCalendarInfo1.DataBindingsForAppointments.StartDateTimeMember = "StartTime";
            //    ultraCalendarInfo1.DataBindingsForAppointments.EndDateTimeMember = "EndTime";
            //    ultraCalendarInfo1.DataBindingsForAppointments.SubjectMember = "Subject";
            //    ultraCalendarInfo1.DataBindingsForAppointments.OwnerKeyMember = "OwnerKey";

            //    // Set Owners data binding properties to UltraCalendarInfo
            //    ultraCalendarInfo1.DataBindingsForOwners.KeyMember = "OwnerKey";
            //    ultraCalendarInfo1.DataBindingsForOwners.NameMember = "Name";

            //    Refresh();
            //}
            //TODO: Pensar se preciso apresentar uma mensagem para o usuário. (verificar se ele cancelou a ação)
            //else MessageBox.Show("", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }
예제 #2
0
        /// <summary>
        /// Handles the BeforeDisplayAppointmentDialog event of the ultraCalendarInfo1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Infragistics.Win.UltraWinSchedule.DisplayAppointmentDialogEventArgs"/> instance containing the event data.</param>
        private void ultraCalendarInfo1_BeforeDisplayAppointmentDialog(object sender, DisplayAppointmentDialogEventArgs e)
        {
            // cancel the displaying of the default AppointmentDialog
            e.Cancel = true;


            // display the Shipping Invoice control
            this.DisplayShippingInvoice((string)e.Appointment.DataKey);
        }