public async Task ValidateDefaultPropertyValues() { await RunOnUIThread(() => { using var _ = new AssertionScope(); var cp = new Windows.UI.Xaml.Controls.CalendarDatePicker(); VERIFY_ARE_EQUAL(cp.FirstDayOfWeek, Windows.Globalization.DayOfWeek.Sunday); VERIFY_ARE_EQUAL(cp.DisplayMode, Windows.UI.Xaml.Controls.CalendarViewDisplayMode.Month); VERIFY_ARE_EQUAL(cp.IsTodayHighlighted, true); VERIFY_ARE_EQUAL(cp.IsOutOfScopeEnabled, true); VERIFY_ARE_EQUAL(cp.IsGroupLabelVisible, false); Windows.Globalization.Calendar calendar = new Windows.Globalization.Calendar(); calendar.SetToNow(); calendar.AddYears(-100); calendar.Month = calendar.FirstMonthInThisYear; calendar.Day = calendar.FirstDayInThisMonth; var minDate = calendar.GetDateTime(); calendar.AddYears(200); calendar.Month = calendar.LastMonthInThisYear; calendar.Day = calendar.LastDayInThisMonth; var maxDate = calendar.GetDateTime(); CompareDate comparer = CalendarHelper.CompareDate; VERIFY_IS_TRUE(comparer(cp.MinDate, minDate)); VERIFY_IS_TRUE(comparer(cp.MaxDate, maxDate)); }); }
protected override int OnQuery(object sender, object neuObject) { if (this.dtBegin.Value > this.dtEnd.Value) { MessageBox.Show("查询起始时间不能大于查询截止时间", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return(-1); } string drugCode = this.ucDrugList1.CurrentSheetView.Cells[this.ucDrugList1.CurrentSheetView.ActiveRowIndex, 0].Text; if (this.hsDrug.ContainsKey(drugCode)) { this.currentDrugCode = drugCode; Neusoft.HISFC.Models.Pharmacy.Item info = this.hsDrug[drugCode] as Neusoft.HISFC.Models.Pharmacy.Item; this.lbTitle.Text = info.NameCollection.RegularName + "明细帐"; this.lbDrugDept.Text = "库存科室:" + this.DrugDept.Name; this.lbSpecs.Text = "规格:" + info.Specs; this.lbDosage.Text = "剂型:" + this.dosageHelper.GetName(info.DosageForm.ID.ToString()); this.lbPackUnit.Text = "包装单位:" + info.PackUnit; if (this.hsProduce.ContainsKey(info.Product.Producer.ID)) { this.lbCompany.Text = "生产厂家:" + this.hsProduce[info.Product.Producer.ID].ToString(); } } if (string.IsNullOrEmpty(this.DrugCode)) { MessageBox.Show("请选择需统计的药品"); return(-1); } DateTime queryBeginDate = System.DateTime.Now.AddYears(-100); DateTime queryEndDate = System.DateTime.Now.AddYears(100); #region 获取统计起始时间 Neusoft.FrameWork.Management.DataBaseManger dataManagement = new Neusoft.FrameWork.Management.DataBaseManger(); string execBeginSql = string.Format(this.getQueryBeginDate, this.DrugDept.ID, Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtBegin.Text).ToString()); string beginDateString = dataManagement.ExecSqlReturnOne(execBeginSql); queryBeginDate = Neusoft.FrameWork.Function.NConvert.ToDateTime(beginDateString); string execEndSql = string.Format(this.getQueryEndDate, this.DrugDept.ID, Neusoft.FrameWork.Function.NConvert.ToDateTime(this.dtEnd.Text).ToString()); string endDateString = dataManagement.ExecSqlReturnOne(execEndSql); queryEndDate = Neusoft.FrameWork.Function.NConvert.ToDateTime(endDateString); if (queryEndDate == DateTime.MinValue) { queryEndDate = dataManagement.GetDateTimeFromSysDateTime().AddDays(1); } #endregion this.lbStatDate.Text = "会计区间:" + queryBeginDate.ToString() + " - " + queryEndDate.ToString(); ArrayList alAllData = new ArrayList(); #region 数据检索 ArrayList alInData = this.QueryItemizedData(this.inItemizedBillSql, DataSource.In, queryBeginDate, queryEndDate); if (alInData == null) { return(-1); } alAllData.AddRange(alInData); ArrayList alOutData = this.QueryItemizedData(this.outItemizedBillSql, DataSource.Out, queryBeginDate, queryEndDate); if (alOutData == null) { return(-1); } alAllData.AddRange(alOutData); ArrayList alAdjustData = this.QueryItemizedData(this.adjuseItemizedBillSql, DataSource.Adjust, queryBeginDate, queryEndDate); if (alAdjustData == null) { return(-1); } alAllData.AddRange(alAdjustData); ArrayList alCheckData = this.QueryItemizedData(this.checkItemizedBillSql, DataSource.Check, queryBeginDate, queryEndDate); if (alCheckData == null) { return(-1); } alAllData.AddRange(alCheckData); ArrayList alMsCurrentData = this.QueryItemizedData(this.msCurrentItemizedBillSql, DataSource.MonthCurrent, queryBeginDate, queryEndDate); if (alMsCurrentData == null) { return(-1); } alAllData.AddRange(alMsCurrentData); ArrayList alMsLastData = this.QueryItemizedData(this.msLastItemizedBillSql, DataSource.MonthLast, queryBeginDate, queryEndDate); if (alMsLastData == null) { return(-1); } alAllData.AddRange(alMsLastData); #endregion CompareDate sortData = new CompareDate(); alAllData.Sort(sortData); return(this.ShowData(alAllData)); }