public void AddNewTask(DataForTaskManager task)
{
DevExpress.XtraScheduler.Appointment apt = schedulerControl1.Storage.CreateAppointment(AppointmentType.Normal);
string[] time = task.StartDay.Split('.');
string year = time[2].Substring(0, 4);
DateTime dateTime = new DateTime(int.Parse(year), int.Parse(time[1]), int.Parse(time[0]));
apt.Start = dateTime;
apt.Start = dateTime.AddDays(1);
apt.Duration = TimeSpan.FromHours(task.RealizationTime);
apt.Subject = task.TaskName;
apt.LabelId = task.IdEmployee;
apt.Description = task.TaskDescription;
schedulerControl1.Storage.Appointments.Add(apt);
ListOfAppointments.Add(apt);
}
I attempted to create a schedule for employee which has to distribute tasks for each employee. But I didn't find some useful information how to distribute tasks according to the time (from 8 a.m. to 4 p.m), and if realization time of task is more than 8 hours how to divide that task for few days.