Ejemplo n.º 1
0
 private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
 {
     var dateToWorkWith = dateTimePicker1.Value;
     RosterService rservice = new RosterService();
     WorkingRoster = rservice.GetRosterForDate(dateToWorkWith);
     Rebind();
 }
Ejemplo n.º 2
0
        private void BuildButton(int day, RosterDay b)
        {
            var dateToWorkWith = dateTimePicker1.Value;
            RosterService rservice = new RosterService();
            WorkingRoster = rservice.GetRosterForDate(dateToWorkWith);
            if (day > 6)
                day = day % 7;
            b.Label = Enum.GetName(typeof(DayOfWeek), day);
            b.DayOfWeek = day;
            b.BindRoster(WorkingRoster);

            b.btnModify.Tag = day;
        }
Ejemplo n.º 3
0
        private void B_Click(object sender, EventArgs e)
        {
            int day = (int)(((Button)sender).Tag);
            AddEditShiftRoster aeda = new AddEditShiftRoster();
            aeda.User = User;
            var dateToWorkWith = dateTimePicker1.Value;
            RosterService rservice = new RosterService();
            WorkingRoster = rservice.GetRosterForDate(dateToWorkWith);
            aeda.DayOfWeek = day;
            aeda.RosterId = WorkingRoster.Id;
            aeda.ShowDialog();
            if (aeda.DialogResult == DialogResult.OK)
            {

                Rebind();
            }
        }
        void RebindShifts()
        {
            var unitofWork = new UnitOfWork();

            RosterService rservice = new RosterService();
            shifts.AddRange(rservice.GetRosterForDate(DateTime.Today.AddDays(0), "Shifts").Shifts);
            shifts.AddRange(rservice.GetRosterForDate(DateTime.Today.AddDays(-7), "Shifts").Shifts);
            shifts.AddRange(rservice.GetRosterForDate(DateTime.Today.AddDays(-14), "Shifts").Shifts);
            dataGridView1.DataSource = shifts.Select(x => new { Day = x.DayOfTheWeek, Employees = GetEmployeeCount(unitofWork, x) }).ToList();
        }