public CurrentSettleControlViewModel(IRoyaltyService royaltySettleService, ISettleBatchService settleBatchService) { this._royaltyService = royaltySettleService; this._settleBatchService = settleBatchService; this.Reload(); this.BatchSelectedCommand = new Prism.Commands.DelegateCommand <object>(BatchSelected); }
public RoyaltySettleControlViewModel( IRoyaltySettleService royaltySettleService, ISettleBatchService settleBatchService, IRoyaltyService royaltyService) { this._royaltySettleService = royaltySettleService; this._settleBatchService = settleBatchService; this._royaltyService = royaltyService; this.batchs = settleBatchService.List().Where(p => p.IsHistory).OrderByDescending(item => item.CreateDate).Select(item => new SettleBatch { Num = item.Num, BeginEnd = $"{item.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}至{item.EndTime.ToString("yyyy-MM-dd HH:mm:ss")}" }).ToArray(); var num = this.batchs.FirstOrDefault()?.Num ?? 0; this.CurrentBatch = this.batchs.FirstOrDefault(); this.Current = null; //this.BatchSelectedCommand = new Prism.Commands.DelegateCommand<object>(BatchSelected); }