Problems modify and delete recurrences

11 posts, 0 answers
  1. ALBERT
    ALBERT avatar
    38 posts
    Member since:
    Dec 2010

    Posted 24 Feb 2011 Link to this post

    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

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     


  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 24 Feb 2011 Link to this post

    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!
  3. ALBERT
    ALBERT avatar
    38 posts
    Member since:
    Dec 2010

    Posted 24 Feb 2011 Link to this post

    recurring appointments I can not modify or delete it, that may not be, since no recurrence appointments if I can modify and delete
  4. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 25 Feb 2011 Link to this post

    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!
  5. André
    André avatar
    15 posts
    Member since:
    Feb 2011

    Posted 25 Feb 2011 Link to this post

    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

  6. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 28 Feb 2011 Link to this post

    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!
  7. André
    André avatar
    15 posts
    Member since:
    Feb 2011

    Posted 28 Feb 2011 Link to this post

    Peter,

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

  8. ALBERT
    ALBERT avatar
    38 posts
    Member since:
    Dec 2010

    Posted 28 Feb 2011 Link to this post

    it was like, and I hope to apply to serve, thank you very much
  9. ALBERT
    ALBERT avatar
    38 posts
    Member since:
    Dec 2010

    Posted 28 Feb 2011 Link to this post

    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?
  10. ALBERT
    ALBERT avatar
    38 posts
    Member since:
    Dec 2010

    Posted 28 Feb 2011 Link to this post

    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
  11. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 02 Mar 2011 Link to this post

    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!
Back to Top