Use Scheduler in a week view without Dates

1 Answer 64 Views
Scheduler and Reminder
Hakim
Top achievements
Rank 1
Hakim asked on 30 Sep 2022, 08:07 PM | edited on 30 Sep 2022, 08:08 PM

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();
           }


 

1 Answer, 1 is accepted

Sort by
0
Maria
Telerik team
answered on 05 Oct 2022, 09:08 AM

Hello Hakim,

Your question has already been answered in the other thread you have opened on the same topic. Please, see our answer there for more information.
We kindly ask you to use just one thread for a specific problem to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

Thank you for your understanding.

Regards,
Maria
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Scheduler and Reminder
Asked by
Hakim
Top achievements
Rank 1
Answers by
Maria
Telerik team
Share this question
or