예제 #1
0
        private void WeekForm_Load(object sender, EventArgs e)
        {
            Today = DateTime.Today;

            var x  = Today.ToPersianDateString().Split('/');
            var xx = Today.ToPersianDateString().AddDaysToShamsiDate(13).Split('/');

            YearStart  = x[0].Substring(2);
            MonthStart = x[1];
            DayStart   = x[2];
            YearEnd    = xx[0].Substring(2);
            MonthEnd   = xx[1];
            DayEnd     = xx[2];

            cmbYearStart.Items.Add(YearStart);
            cmbYearEnd.Items.Add(YearStart);
            if (YearStart != YearEnd)
            {
                cmbYearStart.Items.Add(YearEnd);
                cmbYearEnd.Items.Add(YearEnd);
            }

            cmbYearStart.Text = YearStart;
            cmbYearEnd.Text   = YearEnd;

            cmbMonthStart.Items.Add(MonthStart);
            cmbMonthEnd.Items.Add(MonthStart);
            if (MonthStart != MonthEnd)
            {
                cmbMonthStart.Items.Add(MonthEnd);
                cmbMonthEnd.Items.Add(MonthEnd);
            }

            cmbMonthStart.Text = MonthStart;
            cmbMonthEnd.Text   = MonthEnd;

            var list = Today.ToPersianDateString().ReturnDaysOfMonth();

            cmbDayStart.DataSource = list;

            var listt = Today.AddDays(30).ToPersianDateString().ReturnDaysOfMonth();

            cmbDayEnd.DataSource = listt;

            cmbDayStart.Text = DayStart;
            cmbDayEnd.Text   = DayEnd;
        }