Delete Appointment using "OnAppointmentDelete"

4 posts, 0 answers
  1. Anele
    Anele avatar
    4 posts
    Member since:
    Sep 2011

    Posted 10 Oct 2011 Link to this post

    Hi

    Been trying to deleet an appointment, below is my back code for attempting to delete the appointment

     

     

    public void rsAppointments_AppointmentDelete(object sender, SchedulerCancelEventArgs e)

     

    {

     

    systemBusinessLayer.deleteAppointment(

     

    Convert.ToInt32(e.Appointment.ID));

     

    }



    When i put a brake point I see it doesnt even come near the event.

    below is the code from my businesLayer

    public

     

     

    void deleteAppointment(int appointmentID)

     

    {

     

     

    using (SqlConnection con = new SqlConnection(ConnString))

     

    {

     

     

    SqlCommand cmd = new SqlCommand("procDeleteAppointment", con);

     

    cmd.CommandType =

     

    CommandType.StoredProcedure;

     

    cmd.Parameters.Add(

     

    new SqlParameter("@appointmentID", SqlDbType.Int));

     

    cmd.Parameters[

     

    "@appointmentID"].Value = appointmentID;

     

     

     

    try

     

    {

    con.Open();

    cmd.ExecuteNonQuery();

    }

     

     

    catch (SqlException exp)

     

    {

     

     

    throw new ApplicationException(exp.Message);

     

    }

    }

    }

     


  2. Plamen
    Admin
    Plamen avatar
    3049 posts

    Posted 11 Oct 2011 Link to this post

    Hello Anele,

    You can review how the Delete event is handled in the code behind of the Binding to Generic List demo .

    Hope this will be helpful.

    Greetings,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. Anele
    Anele avatar
    4 posts
    Member since:
    Sep 2011

    Posted 11 Oct 2011 Link to this post

    Hello sir...

    Hei what in god's name is hapening to ma scheduler??When i double click in my appointment so i can update it.Its not opening the modal. check my markup
     below.

    <

     

     

    telerik:RadScheduler ID="RadScheduler1" DataEndField="EndDate"

     

    DataKeyField

     

     

    ="AppointmentId" DataStartField="StartDate" DataSubjectField="Appoitment_Descr"

     

    onappointmentcreated

     

     

    ="RadScheduler1_AppointmentCreated"

     

    ondatabound

     

     

    ="RadScheduler1_DataBound"

     

     

     

    OnAppointmentInsert="rsAppointments_AppointmentInsert"

     

     

     

    OnAppointmentDelete="rsAppointments_AppointmentDelete" AllowDelete="true" AllowEdit="true"

     

     

     

    OnAppointmentUpdate="rsAppointments_AppointmentUpdate" runat="server"

     

     

     

    Width="763px"

     

     

     

    FirstDayOfWeek="Monday" LastDayOfWeek="Friday" Skin="Office2007">

     

     

     

    <AdvancedForm DateFormat="d/M/yyyy" Modal="True"

     

     

     

    EnableCustomAttributeEditing="True" />

     

     

     

    </telerik:RadScheduler>

     

  4. Plamen
    Admin
    Plamen avatar
    3049 posts

    Posted 14 Oct 2011 Link to this post

    Hi Anele,

    I inspected the mark up but there is nothing unusual in it. It looks like the problem is in the code behind. The demo is working as well so you can compare your code with the working code there.

    Kind regards,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top