コード例 #1
0
        /// <summary>
        /// Method to produce the on-duty staff register according to staff with bookings on a selected date.
        /// </summary>
        /// <param name="dateTime">The date selected from the DatePicker</param>
        /// <returns>String list of staff members with appointments on the selected date.</returns>
        public static List <string> ProduceRegister(DateTime dateTime)
        {
            List <string> staff = new List <string>();

            var date = Convert.ToString(dateTime);//DateTimeFormatter.ConvertUsToUkFormat(dateTime.ToString());

            var results = StaffModel.getStaffRegister(date);

            foreach (DataRow row in results.Rows)
            {
                var item = String.Concat(row["Title"].ToString(), ". ", row["Name"].ToString());

                if (staff.Contains(item))
                {
                    continue;
                }

                staff.Add(item);
            }

            return(staff);
        }