This is a migrated thread and some comments may be shown as answers.

Problems modify and delete recurrences

10 Answers 112 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
ALBERT
Top achievements
Rank 1
ALBERT asked on 24 Feb 2011, 01:50 PM
I'm using the control pond in RadScheduler, I have the following problem: the controls, and shows me that I have reservations in the database, I insert, edit and delete reservations, but I did not alter or remove stocks that have recurrence, which may be , leave the respective code:

 

 

object[] opParametrosEmpleados = new object

[2];

 

 

 

opParametrosEmpleados[0] = Session[

 

 

 

"CodigoCliente"

];

 

 

 

opParametrosEmpleados[1] = Session[

 

 

 

"CodigoCompania"

];

 

 

 

DsEmpleado = _fwAccesoDatos.ExecuteDataset(StrCadenaConexion,

 

 

 

"spObtenerListaEmpleados"

, opParametrosEmpleados);

 

 

 

 

 

object[] opParametrosSalas = new object

[2];

 

 

 

opParametrosSalas[0] = Session[

 

 

 

"CodigoCliente"

];

 

 

 

opParametrosSalas[1] = Session[

 

 

 

"CodigoCompania"

];

 

 

 

DsSalas = _fwAccesoDatos.ExecuteDataset(StrCadenaConexion,

 

 

 

"spObtenerListaSalas"

, opParametrosSalas);

 

 

 

 

 

 

 

 

//

RadCalendar1.SelectedDate = RadScheduler1.SelectedDate;

 

 

 

SyncCalendars();

 

opParametros[0] = Session[

 

 

 

"CodigoCliente"

];

 

 

 

opParametros[1] = Session[

 

 

 

"CodigoCompania"

];

 

 

 

DsReservas = _fwAccesoDatos.ExecuteDataset(StrCadenaConexion,

 

 

 

"spObtenerListaReservas"

, opParametros);

 

 

 

 

 

RadScheduler1.DataKeyField =

 

 

 

"CodigoReserva"

;

 

 

 

RadScheduler1.DataStartField =

 

 

 

"FechaHoraInicio"

;

 

 

 

RadScheduler1.DataEndField =

 

 

 

"FechaHoraFin"

;

 

 

 

RadScheduler1.DataSubjectField =

 

 

 

"Asunto"

;

 

 

 

RadScheduler1.DataDescriptionField =

 

 

 

"Descripcion"

;

 

 

 

RadScheduler1.DataRecurrenceField =

 

 

 

"RecurrenceRule"

;

 

 

 

RadScheduler1.DataRecurrenceParentKeyField =

 

 

 

"RecurrenceParentId"

;

 

 

 

RadScheduler1.DataSource = DsReservas.Tables[0];

 

 

 

 

 

 

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

 

 

 

 

 

//roomsS+++++++++++++

 

 

 

 

 

 

ResourceType sa = new ResourceType("Sala" );

 

sa.DataSource = DsSalas.Tables[0];

sa.KeyField =

 

"CodigoSala" ;

 

 

sa.ForeignKeyField = "IdSala" ;

 

sa.TextField = "Descripcion" ;

 

RadScheduler1.ResourceTypes.Add(sa);

 

 

 

 

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

//employee+++++++++++++++++++++

 

 

ResourceType em = new ResourceType("Empleado" );

 

 

em.DataSource = DsEmpleado.Tables[0];

em.KeyField = 

 

"CodigoEmpleado" ;

 

 

em.ForeignKeyField = "CodigoEmpleado" ;

 

em.TextField = "NombresCompletos" ;

 

RadScheduler1.ResourceTypes.Add(em);

control code:

 

<telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Hay" StartInsertingInAdvancedForm="True"

 

 

 OnAppointmentDelete="RadScheduler1_AppointmentDelete" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"  

OnAppointmentInsert="RadScheduler1_AppointmentInsert" OnNavigationComplete="RadScheduler1_NavigationComplete"

 

 

 Height="550px" Width="800px" CustomAttributeNames="Engagement,CodigoEmpleado"

 

 OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" ShowFooter="False"

 

 DayStartTime="07:00:00" WorkDayEndTime="18:00:00" WorkDayStartTime="07:00:00"

 

 OnAppointmentCreated="RadScheduler1_AppointmentCreated" OnFormCreating="RadScheduler1_FormCreating"

 

 OnFormCreated="RadScheduler1_FormCreated" EnableDescriptionField="True" BorderStyle="Solid"

 

 EnableCustomAttributeEditing="True">  

<TimelineView UserSelectable="False" />

 

 

 <

 

 

AppointmentTemplate>

 

 

 

 

 

 

<span style="font-weight: bold; font-size: small"> 

 

 

<div

 

 

 

 

<%

 

 

# Eval("Subject" ) %>

 

 

 

 

 

</div>

 

 

 

 

 

/span >

 

 

 

 <

 

 

%# Eval("Resources[0].text") %>

 

 

 

 

 

 

 

<div >

 

 

 

 

 

 

<%# Eval("Resources[1].text" )%>

 

 

 

 

 

 

 

</div >

 

 

 

 

 

 

</AppointmentTemplate >

 

 

 

 

 

 

<TimeSlotContextMenuSettings EnableDefault="True" />

 

 

 

 

 

 

 

 

<AppointmentContextMenuSettings EnableDefault="True" />

 

 

 

 

 

 

 

 

<AdvancedForm Modal="True" EnableCustomAttributeEditing="True" />

 

 

 

 <

 

 

WeekView DayStartTime="07:00:00" WorkDayEndTime="18:00:00" WorkDayStartTime="07:00:00"/>

 

 

 

 

 

 

<Localization AdvancedAllDayEvent="Todo el d&#237;a" AllDay="Todo el d&#237;a" AdvancedEditAppointment

="Modificar Reserva"

 

 

 

 

 

 

AdvancedNewAppointment="Nueva Reserva" Cancel="Cancelar" ConfirmDeleteText

="Esta seguro de querer eliminar la reserva?"

 

 

 

 

Save="Guardar"/>

 

 

 

 

 

 

<DayView DayStartTime="07:00:00" WorkDayEndTime="18:00:00" WorkDayStartTime="07:00:00" />

 

 

 

 

 

 

</telerik:RadScheduler >

 

 

 

 

 

 

 

 

 

 

modify the code:

 

 

 

 

 

protected

 

 

 

 

 

 

 

 

void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)

 

 

  

 

{

 

 

 

 

opParametrosReservaUpdate[0] = Session[

 

 

 

"CodigoCliente"];

 

 

opParametrosReservaUpdate[1] = Session[

 

"CodigoCompania"];

 

 

 

opParametrosReservaUpdate[2] = e.ModifiedAppointment.Resources[0].Key;

opParametrosReservaUpdate[3] = e.ModifiedAppointment.Attributes[

 

"CodigoEmpleado"].ToString();

 

opParametrosReservaUpdate[4] = e.ModifiedAppointment.ID;

opParametrosReservaUpdate[5] = e.ModifiedAppointment.Subject;

 

opParametrosReservaUpdate[6] = e.ModifiedAppointment.Description;

 

opParametrosReservaUpdate[7] = e.ModifiedAppointment.Start;

 

opParametrosReservaUpdate[8] = e.ModifiedAppointment.End;

 

opParametrosReservaUpdate[9] = e.ModifiedAppointment.Attributes[

 

"Engagement"].ToString();

 

 

 

 

opParametrosReservaUpdate[10] = e.ModifiedAppointment.RecurrenceRule;

 

 

opParametrosReservaUpdate[11] = e.ModifiedAppointment.RecurrenceParentID;

 

opParametrosReservaUpdate[12] = 

 

 

"" ;
 

 

 

 ResultadoReserva = _fwAccesoDatos.ExecuteNonQuery(StrCadenaConexion, 

 

"updateAppoinment", opParametrosReservaUpdate);

 

 

 

 

 

}

Code to eliminate:

 

 

 

 e.Cancel = e.Appointment.Start <

 

DateTime.Now;

 

 

 

 

 

if

(e.Cancel)

 

 {

 

 

 

RadAjaxManager1.Alert(

 

"You can not delete reservations who are before the current date." );

 

 

 

 }

 

 

 

else

 

 

 

 

 

 

{

 

 

 

 

 

 

 

 

 

object[] opParametrosDeleteReserva = new Object [3];

 

 

 

  opParametrosDeleteReserva[0] = Session[

 

"CodigoCliente"];

 

 

 

  opParametrosDeleteReserva[1] = Session["CodigoCompania"];

 

 opParametrosDeleteReserva[2] = e.Appointment.ID.ToString();

 

 

 

 

 

try

 

 {

 

 

 

 _fwAccesoDatos.ExecuteNonQuery(StrCadenaConexion, "clearAppoinment", opParametrosDeleteReserva);

 

 

cargaRadScheduler();

 

 

 }

 

 

 

 

catch (EvaluateException ex)

 

 

 

 {

 

//LOG }

 

 

 

 

}

 

 

 

 }

 

 

 

 

 

 

 

 

thanks for your help

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


10 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 24 Feb 2011, 04:50 PM
Hi ALBERT,

I don't quite understand you question or what the problem is, but in general you can use the approach from the Binding to Generic List demo. I hope you find it helpful.


Greetings,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
ALBERT
Top achievements
Rank 1
answered on 24 Feb 2011, 06:42 PM
recurring appointments I can not modify or delete it, that may not be, since no recurrence appointments if I can modify and delete
0
Peter
Telerik team
answered on 25 Feb 2011, 03:58 PM
Hi ALBERT,

Can you open a support ticket and send us a simple working demo of the problem?

All the best,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
André
Top achievements
Rank 1
answered on 25 Feb 2011, 05:18 PM

You want to delete appointments, but not the recurrence of them (that is, only 1 instance)?

If I got it right, take a look at Figure 6 here:

http://dotnetslackers.com/articles/aspnet/Understanding-Teleriks-Scheduler-Recurrence.aspx

0
Peter
Telerik team
answered on 28 Feb 2011, 03:53 PM
Hi André,

We are glad that you were able to solve the problem yourself and apologize that we could not help you right away.

Don't hesitate to contact us if you have other questions.


Kind regards,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
André
Top achievements
Rank 1
answered on 28 Feb 2011, 05:44 PM

Peter,

I have not solved my problem, which is in the other topic "Display Total work time". I was just trying to help Albert.

0
ALBERT
Top achievements
Rank 1
answered on 28 Feb 2011, 08:04 PM
it was like, and I hope to apply to serve, thank you very much
0
ALBERT
Top achievements
Rank 1
answered on 28 Feb 2011, 08:30 PM
reading the link you sent me Andre, it strikes me that my recurrences are being saved wrong, when I think I saved a recurrence only one record in the database, this is good?
0
ALBERT
Top achievements
Rank 1
answered on 28 Feb 2011, 08:48 PM
and solved the problem that when I delete a recurring appointment call me the update event. I do not understand, how could I solve this problem
0
Peter
Telerik team
answered on 02 Mar 2011, 01:05 PM
Hello ALBERT,

Could you please isolate the problem in a simple working demo and send it to us via a support ticket for further testing? Currently, I am not sure what exactly the problem is or how to replicate it.


Kind regards,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Scheduler
Asked by
ALBERT
Top achievements
Rank 1
Answers by
Peter
Telerik team
ALBERT
Top achievements
Rank 1
André
Top achievements
Rank 1
Share this question
or