Hello,
i'm trying to use the scheduler as a planner.
I've got a EF Model
Shifts
public partial class Shifts
{
public int empId { get; set; }
public int Id { get; set; }
public int day { get; set; }
public System.DateTime start { get; set; }
public System.DateTime end { get; set; }
public int location { get; set; }
public virtual employee employee { get; set; }
}
Locations
public partial class location
{
public location()
{
this.Shifts = new HashSet<Shifts>();
}
public int Id { get; set; }
public string name { get; set; }
public virtual ICollection<Shifts> Shifts { get; set; }
}
Employee
public partial class employee
{
public employee()
{
this.aktiveSchichten = new HashSet<Shifts>();
}
public int Id { get; set; }
public string firstName { get; set; }
public string lastName { get; set; }
public virtual ICollection<aktiveSchichten> aktiveSchichten { get; set; }
}
How do i add start and end for single schedulers by day - possibly integer 0-6? I'm trying to display weekly timeprofiles to load/save
var mitarbeiter = db.employee;
var schichten = db.Shifts.Where(a => a.location == (int)radMultiColumnComboBox2.SelectedValue);
foreach (var schicht in schichten)
{
radScheduler1.Appointments.BeginUpdate();
int count = 1;
foreach (var ma in mitarbeiter)
{
this.radScheduler1.Resources.Add(new Resource(count++, ma.firstName + ma.lastName));
}
DateTime start = ?;
DateTime end = ?;
Appointment appointment1 = new Appointment(start, end, schicht.employee.firstName + schicht.employee.firstName, "test");
appointment1.BackgroundId = (int)AppointmentBackground.Anniversary;
appointment1.StatusId = (int)AppointmentStatus.Unavailable;
radScheduler1.Appointments.Add(appointment1);
radScheduler1.Appointments.EndUpdate();
}