public void UpdateDutyExchangeList()
        {
            List <DutyExchange> dutyExchanges         = DutyExchangeRepository.GetDutyExchanges();
            List <DutyListView> dutyExchangeListViews = new List <DutyListView>();

            foreach (DutyExchange dutyExchange in dutyExchanges)
            {
                dutyExchangeListViews.Add(new DutyListView
                {
                    Duty         = DutyRepository.GetDuty(dutyExchange.DutyID),
                    EmployeeName = EmployeeRepository.GetEmployeeName(dutyExchange.EmployeeID)
                });
            }
            DutyExchangeListView.ItemsSource   = dutyExchangeListViews;
            DutyExchangeListView.SelectedIndex = -1;
        }
Ejemplo n.º 2
0
        public void UpdateDutyList2()
        {
            List <DutyExchange> dutyExchanges    = DutyExchangeRepository.GetDutyExchanges();
            List <string>       newDutyExchanges = new List <string>();

            if (dutyExchanges.Count > 0)
            {
                foreach (DutyExchange dutyExchange in dutyExchanges)
                {
                    string newDutyExchange = DateRepository.GetDate(DutyRepository.GetDuty(dutyExchange.DutyID).DateID).Date.ToString().Substring(0, 10) + " <--> " + EmployeeRepository.GetEmployee(dutyExchange.EmployeeID).FirstName;
                    newDutyExchanges.Add(newDutyExchange);
                }
                DutyList2.ItemsSource = newDutyExchanges;
            }
            else
            {
                DutyList2.ItemsSource = null;
            }
        }