Пример #1
0
        private void radioButton11_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton11.Checked)
            {
                is_weekend  = false;
                is_weekday  = false;
                day_of_week = false;

                is_specific      = true;
                date             = PayoutDateSelector.SelectDate();
                day_of_week_type = 10;
                label4.Text      = date.ToString("MMM dd, yyyy");
                //MessageBox.Show( "Popup a calendar to select..." );
            }
        }
Пример #2
0
        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            ButtonBase cb = sender as ButtonBase;

            is_weekend  = false;
            is_weekday  = false;
            day_of_week = false;
            is_specific = false;
            RadioButton rb = sender as RadioButton;

            if (!rb.Checked)
            {
                return;
            }
            switch (cb.Text)
            {
            case "Default":
                day_of_week_type = -1;
                break;

            case "Monday":
                dow_specific = DayOfWeek.Monday;
                day_of_week  = true;
                break;

            case "Tuesday":
                dow_specific = DayOfWeek.Tuesday;
                day_of_week  = true;
                break;

            case "Wednesday":
                dow_specific = DayOfWeek.Wednesday;
                day_of_week  = true;
                break;

            case "Thursday":
                dow_specific = DayOfWeek.Thursday;
                day_of_week  = true;
                break;

            case "Friday":
                dow_specific = DayOfWeek.Friday;
                day_of_week  = true;
                break;

            case "Saturday":
                dow_specific = DayOfWeek.Saturday;
                day_of_week  = true;
                break;

            case "Sunday":
                dow_specific = DayOfWeek.Sunday;
                day_of_week  = true;
                break;

            case "Weekday":
                is_weekday = true;
                break;

            case "Weekend":
                is_weekend = true;
                break;

            case "Specific Day":
                // this is handled by it's own cuseom rotuine
                is_specific = true;
                date        = PayoutDateSelector.SelectDate();
                break;
            }
            if (is_specific)
            {
                day_of_week_type = 10;
            }
            if (is_weekend)
            {
                day_of_week_type = 9;
            }
            else if (is_weekday)
            {
                day_of_week_type = 8;
            }
            else if (day_of_week)
            {
                day_of_week_type = ((int)dow_specific) + 1;
            }

            if (day_of_week_type != 10)
            {
                date = DateTime.MinValue;
            }

            UpdatePriceGrid();
        }