public PaymentHistoryPage() { InitializeComponent(); NavigationPage.SetHasBackButton(this, true); BindingContext = model = new PaymentHistoryViewModel(); }
private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { ListView listView = sender as ListView; switch (listView.SelectedIndex) { case 0: DataContext = new CarViewModel(); break; case 1: DataContext = new ContractViewModel(); break; case 2: DataContext = new MediatorViewModel(); break; case 3: DataContext = new ReportViewModel(); break; case 4: DataContext = new NotificationViewModel(); break; case 5: DataContext = new PaymentHistoryViewModel(); break; } }
public async Task <IActionResult> AddPayment([FromBody] PaymentHistoryViewModel paymentHistoryViewModel) { var mapper = new MapperConfiguration(cfg => cfg.CreateMap <PaymentHistoryViewModel, PaymentHistoryDto>()) .CreateMapper(); var paymentDto = mapper.Map <PaymentHistoryViewModel, PaymentHistoryDto>(paymentHistoryViewModel); await _paymentHistoryService.Add(paymentDto); return(Ok()); }
protected override void OnLoad(EventArgs e) { if (!this.DesignMode) { TranslateLabels(); // Create a collection of pages this.pages = new List <OrderDetailsPage>(this.panelControl.Controls.Count); this.pages.Add(this.orderInformationPage); this.pages.Add(this.customerInformationPage); this.pages.Add(this.itemDetailsPage); this.pages.Add(this.deliveryInformationPage); this.pages.Add(this.paymentHistoryPage); this.pages.Add(this.cancellationChargePage); this.pages.Add(this.summaryPage); // Create a collection of view models pageViewModels = new List <PageViewModel>(); orderDetailsViewModel = new OrderDetailsViewModel(this.transaction, this.mode); orderSummaryViewModel = new OrderSummaryViewModel(this.transaction); customerInformationViewModel = new CustomerInformationViewModel(this.transaction); paymentHistoryViewModel = new PaymentHistoryViewModel(this.transaction); itemDetailsViewModel = new ItemDetailsViewModel(this.transaction); this.pageViewModels.Add(orderDetailsViewModel); this.pageViewModels.Add(orderSummaryViewModel); this.pageViewModels.Add(customerInformationViewModel); this.pageViewModels.Add(paymentHistoryViewModel); this.pageViewModels.Add(itemDetailsViewModel); // Listen to the property changed event on each view model this.pageViewModels.ForEach(vm => vm.PropertyChanged += new PropertyChangedEventHandler(OnPageViewModel_PropertyChanged)); // Set on each page this.bindingSource.Add(orderDetailsViewModel); this.orderDetailsNavBar.SetViewModel(this.ViewModel); this.orderInformationPage.SetViewModel(this.ViewModel); this.itemDetailsPage.SetViewModel(itemDetailsViewModel); this.deliveryInformationPage.SetViewModel(this.ViewModel); this.customerInformationPage.SetViewModel(customerInformationViewModel); this.paymentHistoryPage.SetViewModel(paymentHistoryViewModel); this.cancellationChargePage.SetViewModel(this.ViewModel); this.summaryPage.SetViewModel(orderSummaryViewModel); this.ViewModel.SelectedPageIndex = GetStartPageIndex(); this.ViewModel.SelectedPageTitle = this.pages[this.ViewModel.SelectedPageIndex].Text; } base.OnLoad(e); }
public async Task <ActionResult <IEnumerable <PaymentHistoryViewModel> > > GetPaymentHistories() { var paymentHistories = await _context.PaymentHistories.Include(c => c.CreditUnion).ToListAsync(); var paymentHistoryViewModels = new List <PaymentHistoryViewModel>(); if (paymentHistories != null && paymentHistories.Any()) { paymentHistories.ForEach(c => { PaymentHistoryViewModel viewModel = new PaymentHistoryViewModel { CreditUnionId = c.CreditUnionId, PayeeName = c.CreditUnion.Name, Amount = c.Amount, Id = c.Id }; paymentHistoryViewModels.Add(viewModel); }); } return(paymentHistoryViewModels); }
protected override void OnLoad(EventArgs e) { if (!this.DesignMode) { TranslateLabels(); // Create a collection of pages this.pages = new List <OrderDetailsPage>(this.panelControl.Controls.Count); this.pages.Add(this.orderInformationPage); this.pages.Add(this.customerInformationPage); this.pages.Add(this.itemDetailsPage); this.pages.Add(this.deliveryInformationPage); this.pages.Add(this.paymentHistoryPage); this.pages.Add(this.cancellationChargePage); this.pages.Add(this.summaryPage); // Create a collection of view models pageViewModels = new List <PageViewModel>(); orderDetailsViewModel = new OrderDetailsViewModel(this.transaction, this.mode); orderSummaryViewModel = new OrderSummaryViewModel(this.transaction); customerInformationViewModel = new CustomerInformationViewModel(this.transaction); paymentHistoryViewModel = new PaymentHistoryViewModel(this.transaction); itemDetailsViewModel = new ItemDetailsViewModel(this.transaction); this.pageViewModels.Add(orderDetailsViewModel); this.pageViewModels.Add(orderSummaryViewModel); this.pageViewModels.Add(customerInformationViewModel); this.pageViewModels.Add(paymentHistoryViewModel); this.pageViewModels.Add(itemDetailsViewModel); // Listen to the property changed event on each view model this.pageViewModels.ForEach(vm => vm.PropertyChanged += new PropertyChangedEventHandler(OnPageViewModel_PropertyChanged)); // Set on each page this.bindingSource.Add(orderDetailsViewModel); this.orderDetailsNavBar.SetViewModel(this.ViewModel); this.orderInformationPage.SetViewModel(this.ViewModel); this.itemDetailsPage.SetViewModel(itemDetailsViewModel); this.deliveryInformationPage.SetViewModel(this.ViewModel); this.customerInformationPage.SetViewModel(customerInformationViewModel); this.paymentHistoryPage.SetViewModel(paymentHistoryViewModel); this.cancellationChargePage.SetViewModel(this.ViewModel); this.summaryPage.SetViewModel(orderSummaryViewModel); this.ViewModel.SelectedPageIndex = GetStartPageIndex(); this.ViewModel.SelectedPageTitle = this.pages[this.ViewModel.SelectedPageIndex].Text; // for a customer order that is not on Create state (i.e. some operation has been performed on it, e.g. processing, packingslip, invoicing, etc) // then we cannot let the user click on the save button and edit this order bool saveButtonDisabled = this.transaction.Mode == CustomerOrderMode.Edit && this.transaction.OrderStatus != SalesStatus.Created; // Modificado por Adrián Barquero para FES; Se requeria que se puedan generar anticipos a las ordenes de ventas que tuvieran el status: // Editado o Procesando if (this.transaction.Mode == CustomerOrderMode.Edit && (this.transaction.OrderStatus == SalesStatus.Processing || this.transaction.OrderStatus == SalesStatus.Invoiced)) { this.btnSave.Enabled = true; } else { this.btnSave.Enabled = !saveButtonDisabled; } } base.OnLoad(e); try { if (this.transaction.PartnerData.isSuspended) { this.ViewModel.SelectedPageIndex = pages.IndexOf(deliveryInformationPage); this.transaction.PartnerData.isSuspended = false; this.transaction.Save(); this.btnSave.PerformClick(); } } catch (Exception ex) { } }
public ActionResult Index(string projectGuid) { //Load project info var projectIds = m_dbAdapter.Authority.GetAuthorizedProjectIds(); var projects = m_dbAdapter.Project.GetProjects(projectIds); //Init view model var viewModel = new PaymentHistoryViewModel(); Project project = null; if (string.IsNullOrEmpty(projectGuid)) { if (projects.Count == 0) { return(View(viewModel)); } project = projects[0]; } else { project = projects.Single(x => x.ProjectGuid == projectGuid); } //Load project Model info if (project.ModelId > 0) { project.Model = m_dbAdapter.Project.GetModel(project.ModelId); } viewModel.CurrentProject = project; viewModel.Datasets = new List <DatasetViewModel>(); viewModel.Projects = projects.ConvertAll(Toolkit.ConvertProject); //Load note info var notes = m_dbAdapter.Dataset.GetNotes(project.ProjectId); var cnabsNotes = new ProjectLogicModel(CurrentUserName, project).Notes; var noteDict = Toolkit.GetNoteDictionary(project, notes, cnabsNotes); notes.ForEach(x => CommUtils.Assert(noteDict.ContainsKey(x.NoteId), "找不到Note信息,noteId={0},noteName={1},ProjectId={2},SecurityCode={3},ShortName={4}", x.NoteId, x.NoteName, x.ProjectId, x.SecurityCode, x.ShortName)); viewModel.NoteInfos = notes.ConvertAll(x => noteDict[x.NoteId]); var logicModel = new ProjectLogicModel(CurrentUserName, project.ProjectGuid); DateTime[] paymentDates; try { paymentDates = logicModel.DealSchedule.DurationPeriods.Select(x => x.PaymentDate).ToArray(); } catch (ApplicationException) { //没有偿付模型 return(View(viewModel)); } var datasetSchedule = logicModel.DealSchedule.GetByPaymentDay(DateTime.Now); //Load dataset info while (datasetSchedule != null) { if (datasetSchedule.Dataset.Instance != null) { if (datasetSchedule.Dataset.ReinvestmentCsv != null) { //不处理循环购买类产品的偿付历史相关 viewModel.HasReinvestmentInfo = true; return(View(viewModel)); } var noteDatas = m_dbAdapter.Dataset.GetNoteDatas(datasetSchedule.Dataset.Instance.DatasetId); var datasetViewModel = Toolkit.GetDatasetViewModel(datasetSchedule.Dataset.Instance, paymentDates, noteDict, noteDatas); viewModel.Datasets.Add(datasetViewModel); } datasetSchedule = datasetSchedule.Previous; } var allPaymentDays = new List <DateTime>(); if (project.CnabsDealId.HasValue) { allPaymentDays = m_dbAdapter.Model.GetPaymentDates(project.CnabsDealId.Value); } else { if (logicModel.DealSchedule.Instanse != null) { allPaymentDays = logicModel.DealSchedule.Instanse.PaymentDates.ToList(); } } //Load asset cashflow data try { viewModel.AssetDatasets = new List <AssetDatasetViewModel>(); viewModel.AssetDatasets = GetAssetCashflow(project.ProjectId, paymentDates, allPaymentDays); } catch (ApplicationException e) { viewModel.ExceptionMessage = e.Message + System.Environment.NewLine + e.StackTrace; } Dictionary <string, List <Vector> > series = new Dictionary <string, List <Vector> >(); series["本金"] = new List <Vector>(); series["利息"] = new List <Vector>(); foreach (var assetDataset in viewModel.AssetDatasets) { var sumInfo = assetDataset.SumAsset; series["本金"].Add(new Vector(assetDataset.PaymentDay, decimal.Parse(sumInfo.Principal.ToString("n2")))); series["利息"].Add(new Vector(assetDataset.PaymentDay, decimal.Parse(sumInfo.Interest.ToString("n2")))); } var dataSeriesList = new List <DataSeries>(); foreach (var key in series.Keys) { var ds = new DataSeries(); ds.name = key; ds.data = series[key]; dataSeriesList.Add(ds); } viewModel.AssetChartData = JsonConvert.SerializeObject(dataSeriesList); return(View(viewModel)); }