コード例 #1
0
        private void _helper_LoadGridDataSource(object sender, EventArgs e)
        {
            this._initialWebGrid();
            if (this._checkRequireFields())
            {
                int iDateFrom = 0;
                int iDateTo   = 0;
                if (dateGroupType.ToUpper() == "WEEK")
                {
                    DateTime dt1 = DateTime.Today.AddDays(Convert.ToInt32(DateTime.Today.DayOfWeek) * -1 + 1);
                    iDateFrom = FormatHelper.TODateInt(dt1);
                    iDateTo   = FormatHelper.TODateInt(dt1.AddDays(6));
                }
                else if (dateGroupType.ToUpper() == "MONTH")
                {
                    DateTime dt1 = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
                    iDateFrom = FormatHelper.TODateInt(dt1);
                    iDateTo   = FormatHelper.TODateInt(dt1.AddMonths(1).AddDays(-1));
                }
                else
                {
                    iDateFrom = iDateTo = FormatHelper.TODateInt(DateTime.Today);
                }
                FacadeFactory facadeFactory = new FacadeFactory(base.DataProvider);
                object[]      dataSource    =
                    facadeFactory.CreateQueryFacade2().QueryOQCErrorCode(
                        segmentCode,
                        iDateFrom, iDateTo);

                (e as WebQueryEventArgs).GridDataSource = dataSource;

                (e as WebQueryEventArgs).RowCount =
                    facadeFactory.CreateQueryFacade2().QueryOQCErrorCodeCount(
                        segmentCode,
                        iDateFrom, iDateTo);

                this._processOWC(dataSource);
            }
        }