public async void ExecuteOpenQuotationCommand(RecentItemViewModel recentItem) { string errorMessage = string.Empty; string quotationNo = recentItem.Model.QuotationNo; //DataSet quotationDataSet = quotationDb.GetNRICDetails(nric, out errorMessage); DataSet quotationDataSet = quotationDb.GetMIQuoationDetails(quotationNo, out errorMessage); if (!string.IsNullOrEmpty(errorMessage)) { await this.Container.Resolve <IMetroMessageDisplayService>(ServiceNames.MetroMessageDisplayService).ShowMessageAsnyc("Open Recent Item", errorMessage); return; } else if (quotationDataSet != null && quotationDataSet.Tables.Count == 4 && quotationDataSet.Tables[0].Rows.Count > 0) { this.RegionManager.RequestNavigate(RegionNames.MainRegion, WindowNames.MotorViewQuotation); this.EventAggregator.GetEvent <OpenQuotationEvent>().Publish(new QuotationEventArgs { QuotationDataSet = quotationDataSet, RegionName = RegionNames.MotorQuotationRegion, Source = WindowNames.MotorSummaryDetail }); } else { await this.Container.Resolve <IMetroMessageDisplayService>(ServiceNames.MetroMessageDisplayService).ShowMessageAsnyc("Open Recent Item", "Quotation record does not exist"); return; } }
public bool CanExecuteOpenQuotationCommand(RecentItemViewModel recentItem) { return(true); }