using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OwnControls
{
    public partial class CheckBoxFieldDays : UserControl
    {
        public CheckBoxFieldDays()
        {
            InitializeComponent();
        }

        public List<string> getCheckedDaysList()
        {
            List<string> checkedDaysList = new List<string>();
            
            if (checkBoxMonday.Checked)
            {
                checkedDaysList.Add("monday");
            }
            if (checkBoxTuesday.Checked)
            {
                checkedDaysList.Add("tuesday");
            }
            if (checkBoxWednesday.Checked)
            {
                checkedDaysList.Add("wednesday");
            }
            if (checkBoxThursday.Checked)
            {
                checkedDaysList.Add("thursday");
            }
            if (checkBoxFriday.Checked)
            {
                checkedDaysList.Add("friday");
            }
            if (checkBoxSaturday.Checked)
            {
                checkedDaysList.Add("saturday");
            }
            if (checkBoxSunday.Checked)
            {
                checkedDaysList.Add("sunday");
            }

            if (checkedDaysList.Count == 0)
            {
                return null;
            }
            else
            {
                return checkedDaysList;
            }
        }
    }
}
