private void ucReportBase_Load(object sender, EventArgs e) { try { this.neuSpread1_Sheet1.SetColumnAllowAutoSort(-1, true); Neusoft.FrameWork.Management.DataBaseManger data = new Neusoft.FrameWork.Management.DataBaseManger(); this.dtpBeginDate.Value = DateTime.Parse(data.GetSysDate() + " 00:00:00"); //起始时间 this.dtpEndDate.Value = DateTime.Parse(data.GetSysDate() + " 23:59:59"); //结束时间 if (!this.isShowDetailTab) { this.InitTabPage(); } } catch { } }
public void Init() { try { //取系统日期 Neusoft.FrameWork.Management.DataBaseManger dataBase = new Neusoft.FrameWork.Management.DataBaseManger(); string sysDate = dataBase.GetSysDate(); this.dtpBeginDate.Value = DateTime.Parse(sysDate + " 00:00:00"); //起始日期 this.dtpEndDate.Value = DateTime.Parse(sysDate + " 23:59:59"); //结束日期 if (this.myIsOneDate) { //用户只可以选择一个日期的时候 this.lblBeginDate.Text = "日期:"; //不显示终止日期 this.lblEndDate.Visible = false; this.dtpEndDate.Visible = false; } else { //用户只可以选择起始日期和终止日期的时候 this.lblBeginDate.Text = "起始日期:"; //不显示终止日期 this.lblEndDate.Visible = true; this.dtpEndDate.Visible = true; } } catch {} }