Exemple #1
0
        private void RefreshView(ViewQueryInfo queryInfo)
        {
            if (ribbon.SelectedPage == rPageFront)
            {
                fmFrontView.QInfo = queryInfo;
                return;
            }

            if (ribbon.SelectedPage == rPageDCC)
            {
                fmDCCView.QInfo = queryInfo;
                return;
            }
            if (ribbon.SelectedPage == rPageOrder)
            {
                fmOrderView.QInfo = queryInfo;
                return;
            }
        }
Exemple #2
0
        /// <summary>
        /// 获取(全记录)时间查询条件 
        /// </summary>
        /// <param name="dateRange"></param>
        /// <returns></returns>
        private ViewQueryInfo GetViewDateQuery(QueryDateRange dateRange)
        {
            var dateNow = DateTime.Now;
            var startDate = DateTime.Now;
            var endDate = dateNow;

            //if (dateRange == QueryDateRange.ThisWeek)
            //    startDate = dateNow.AddDays(1 - Convert.ToInt32(dateNow.DayOfWeek.ToString("d")));

            if (dateRange == QueryDateRange.ThisMonth)
                startDate = dateNow.AddDays(1 - dateNow.Day);

            if (dateRange == QueryDateRange.ThisQuarter)
                startDate = dateNow.AddMonths(0 - (dateNow.Month - 1) % 3).AddDays(1 - dateNow.Day);

            if (dateRange == QueryDateRange.ThisYear)
                startDate = new DateTime(dateNow.Year, 1, 1);

            if (dateRange == QueryDateRange.Customer)
            {
                FmCustomTime customTime = new FmCustomTime();
                customTime.StartDate = CurQueryInfo.StartDate.HasValue ? CurQueryInfo.StartDate.Value : DateTime.Now;
                customTime.EndDate = CurQueryInfo.EndDate.HasValue ? CurQueryInfo.EndDate.Value : DateTime.Now;

                if (customTime.ShowDialog() == DialogResult.OK)
                {
                    ViewQueryInfo queryInfo = new ViewQueryInfo();
                    startDate = customTime.StartDate;
                    endDate = customTime.EndDate;
                }
            }
            return new ViewQueryInfo() { DateRange = dateRange, StartDate = startDate, EndDate = dateNow };
            //return new ViewQueryGoodsInfo() { DateRange = dateRange, StartPurchaseDate = startDate, StartSaledDate = startDate, EndPurchaseDate = dateNow, EndSaledDate = dateNow };
        }