コード例 #1
0
        private void AutoFillInDatePicker()
        {
            DateTime currenttime = CommonFunc.GetZoneTime(GlobalVar._timezoneId);
            DateTime date        = CommonFunc.SetZoneTime(GlobalVar._timezoneId,
                                                          currenttime.Date,
                                                          Convert.ToInt32(tb_starttime_hour.Text),
                                                          Convert.ToInt32(tb_starttime_min.Text));

            if (IsPreviousTime(date, currenttime))
            {
                datepicker_startdate.SelectedDate = date.AddDays(1).Date;
            }
            else
            {
                datepicker_startdate.SelectedDate = date.Date;
            }
        }
コード例 #2
0
        private DateTime GetStartTime()
        {
            DateTime date;

            if (rb_starttime_now.IsChecked == true)
            {
                date = temp_currenttime.AddSeconds(Parameter.delay_sec);
            }
            else
            {
                date = CommonFunc.SetZoneTime(GlobalVar._timezoneId,
                                              datepicker_startdate.SelectedDate.Value.Date,
                                              Convert.ToInt32(tb_starttime_hour.Text),
                                              Convert.ToInt32(tb_starttime_min.Text));
            }

            return(date);
        }
コード例 #3
0
        private DateTime GetEndTime()
        {
            DateTime date;

            if (rb_set_endtime.IsChecked == true)
            {
                date = CommonFunc.SetZoneTime(GlobalVar._timezoneId,
                                              datepicker_startdate.SelectedDate.Value.Date,
                                              Convert.ToInt32(tb_endtime_hour.Text),
                                              Convert.ToInt32(tb_endtime_min.Text));

                if (IsPreviousTime(date, temp_starttime))
                {
                    date = date.AddDays(1);
                }
            }
            else
            {
                date = temp_starttime.AddSeconds(CalculateDuration2sec());
            }

            return(date);
        }