private void button_chargingHistory_getDateRange_Click(object sender, EventArgs e)
        {
            string   strError = "";
            int      nRet     = 0;
            DateTime start;
            DateTime end;

            nRet = Global.ParseTimeRangeString(this.textBox_chargingHistory_dateRange.Text,
                                               false,
                                               out start,
                                               out end,
                                               out strError);

            /*
             * if (nRet == -1)
             * {
             *  MessageBox.Show(this, strError);
             *  return;
             * }*/

            TimeRangeDlg dlg = new TimeRangeDlg();

            MainForm.SetControlFont(dlg, this.Font, false);

            dlg.Text               = "借阅历史日期范围";
            dlg.StartDate          = start;
            dlg.EndDate            = end;
            dlg.AllowStartDateNull = true; // 允许起点时间为空
            dlg.AllowEndDateNull   = true; // 允许终点时间为空

            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult == DialogResult.Cancel)
            {
                return;
            }

            this.textBox_chargingHistory_dateRange.Text = Global.MakeTimeRangeString(dlg.StartDate, dlg.EndDate);
        }
示例#2
0
        private void button_chargingHistory_getDateRange_Click(object sender, EventArgs e)
        {
            string strError = "";
            int nRet = 0;
            DateTime start;
            DateTime end;

            nRet = Global.ParseTimeRangeString(this.textBox_chargingHistory_dateRange.Text,
                false,
                out start,
                out end,
                out strError);
            /*
            if (nRet == -1)
            {
                MessageBox.Show(this, strError);
                return;
            }*/

            TimeRangeDlg dlg = new TimeRangeDlg();
            MainForm.SetControlFont(dlg, this.Font, false);

            dlg.Text = "借阅历史日期范围";
            dlg.StartDate = start;
            dlg.EndDate = end;
            dlg.AllowStartDateNull = true;  // 允许起点时间为空
            dlg.AllowEndDateNull = true;  // 允许终点时间为空

            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult == DialogResult.Cancel)
                return;

            this.textBox_chargingHistory_dateRange.Text = Global.MakeTimeRangeString(dlg.StartDate, dlg.EndDate);
        }