Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In My Website I use rad scheduler control.
In EDIT APPOINTMENT I CAN NOT DATA UPDATED.
PLEASE GIVE ME SOLUTION.

my code

public partial class Modules_Admin_zonewiseDailyworkingschedule : System.Web.UI.Page
{
DataClasses2DataContext con = new DataClasses2DataContext();
long companyid;
long fid;

protected void Page_Load(object sender, EventArgs e)
{
Session["companyid"] = 4;
companyid = Convert.ToInt64(Session["companyid"]);


bindrad();

}

protected void RadScheduler1_AppointmentInsert(object sender, Telerik.Web.UI.AppointmentInsertEventArgs e)
{
EmployeeSchedule emp = new EmployeeSchedule()
{
fieldstaffid = Convert.ToInt64(Session["fidzone"]),
starttime = e.Appointment.Start,
endtime = e.Appointment.End,
person_to_met = e.Appointment.Attributes["Person_To_Met"].ToString(),
dt = e.Appointment.Start.Date,
Description = e.Appointment.Description,
subject = e.Appointment.Subject
};
con.EmployeeSchedules.InsertOnSubmit(emp);
con.SubmitChanges();


}
protected void RadScheduler1_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e)
{
var r = con.EmployeeSchedules.Where(q => q.Scheduleid == Convert.ToInt64(e.Appointment.ID)).Single();
r.starttime = e.Appointment.Start;
r.endtime = e.Appointment.End;
r.subject = e.Appointment.Subject;
r.Description = e.Appointment.Description;
con.SubmitChanges();

}
protected void RadScheduler1_AppointmentDelete(object sender, Telerik.Web.UI.AppointmentDeleteEventArgs e)
{

var r = (from a in con.EmployeeSchedules
where a.Scheduleid == Convert.ToInt64(e.Appointment.ID)
select a).Single();

con.EmployeeSchedules.DeleteOnSubmit(r);
con.SubmitChanges();
bindrad();
}

protected void bindrad()
{
var r = from a in con.EmployeeSchedules
where a.fieldstaffid == Convert.ToInt64(Session["fidzone"])
select a;

RadScheduler1.DataSource = r;
RadScheduler1.DataBind();

}


protected void Button1_Click(object sender, EventArgs e)
{
bindrad();
}
protected void RadScheduler1_AppointmentDataBound(object sender, Telerik.Web.UI.SchedulerEventArgs e)
{
Label2.Text = e.Appointment.Subject;
}
protected void RadScheduler1_DataBound(object sender, EventArgs e)
{

}
protected void RadScheduler1_AppointmentCommand(object sender, Telerik.Web.UI.AppointmentCommandEventArgs e)
{

}
}
Posted
Updated 20-Dec-12 21:51pm
v2
Comments
[no name] 21-Dec-12 3:30am    
Provide your code so that we can see what is happening over here ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900