Exemplo n.º 1
0
        /// <summary>
        /// 根据开始时间,结束时间查询开门记录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtQuery_Click(object sender, EventArgs e)
        {
            if (this.dateStart.Text == string.Empty)
            {
                XtraMessageBox.Show("请输入开始时间", "系统提示!");
                return;
            }
            if (this.dateEnd.Text == string.Empty)
            {
                XtraMessageBox.Show("请输入结束时间", "系统提示!");
                return;
            }

            string dataStart = this.dateStart.Text.Trim();
            string dataEnd   = this.dateEnd.Text.Trim();

            string where = " 时间 >=  '" + dataStart + "' and 时间 <= '" + dataEnd + "' ";
            if (this.lookDoor.EditValue != null && this.lookDoor.EditValue.ToString() != "全部")
            {
                where += " and 门编号='" + this.lookDoor.EditValue.ToString() + "'";
            }
            this.paramwin = BindManager.getSystemParam();
            NameObjectList ps = new NameObjectList();

            ps["StartDate"] = this.dateStart.EditValue.ToString();
            ps["EndDate"]   = this.dateEnd.EditValue.ToString();
            ParamManager.MergeParam(ps, this.paramwin, false);
            this.unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName);
            this.ds       = this.bindMgr.BuildDataset(this.unitItem, ps);
            DataTable dt       = this.ds.Tables["刷卡记录"].Clone();
            DataTable dtReport = FunShare.GetTable(dt, this.ds.Tables["刷卡记录"].Select(where));

            Report.viwReports View = new viwReports();
            View.ReportName = "刷卡报表";
            View.dt         = dt;
            View.StartTime  = this.dateStart.Text.Trim();
            View.EndTime    = this.dateEnd.Text.Trim();
            View.Activate();
            View.Dock = DockStyle.Fill;
            this.groReport.Controls.Clear();
            this.groReport.Controls.Add(View);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据开始时间,结束时间查询开门记录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtQuery_Click(object sender, EventArgs e)
        {
            if( this.dateStart.Text ==string.Empty )
            {
                XtraMessageBox.Show("请输入开始时间","系统提示!");
                return;
            }
            if (this.dateEnd.Text == string.Empty)
            {
                XtraMessageBox.Show("请输入结束时间", "系统提示!");
                return;
            }

            string  dataStart= this.dateStart.Text.Trim();
            string dataEnd = this.dateEnd.Text.Trim();
            string where = " 时间 >=  '" + dataStart + "' and 时间 <= '" + dataEnd + "' ";
            if (this.lookDoor.EditValue != null && this.lookDoor.EditValue.ToString() != "全部")
            {
                where += " and 门编号='" + this.lookDoor.EditValue.ToString() + "'";
            }
            this.paramwin = BindManager.getSystemParam();
            NameObjectList ps = new NameObjectList();
            ps["StartDate"] = this.dateStart.EditValue.ToString();
            ps["EndDate"] = this.dateEnd.EditValue.ToString();
            ParamManager.MergeParam(ps, this.paramwin, false);
            this.unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName);
            this.ds = this.bindMgr.BuildDataset(this.unitItem,ps);
            DataTable dt = this.ds.Tables["刷卡记录"].Clone();
            DataTable dtReport = FunShare.GetTable(dt, this.ds.Tables["刷卡记录"].Select(where));
            Report.viwReports View = new viwReports();
            View.ReportName = "刷卡报表";
            View.dt = dt;
            View.StartTime = this.dateStart.Text.Trim();
            View.EndTime = this.dateEnd.Text.Trim();
            View.Activate();
            View.Dock = DockStyle.Fill;
            this.groReport.Controls.Clear();
            this.groReport.Controls.Add(View);
        }