Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Acr.UserDialogs;
- using SlogGISMobile.Models.Jianstra.Infobekum;
- using SlogGISMobile.Services;
- using Syncfusion.SfChart.XForms;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.ComponentModel;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Input;
- using Xamarin.Forms;
- using Xamarin.Forms.Internals;
- namespace SlogGISMobile.ViewModels.Jianstra.infobekum
- {
- [Preserve(AllMembers = true)]
- public class StatistikInfobekumLanjutanViewModel : BaseViewModel {
- public ObservableCollection<Book> Data { get; set; }
- private double pertamax;
- private double pertamax_rm;
- private double pertamax_pnbp;
- public double Pertamax
- {
- get { return pertamax; }
- set
- {
- pertamax = value;
- this.NotifyPropertyChanged();
- }
- }
- public double Pertamax_rm
- {
- get { return pertamax_rm; }
- set
- {
- pertamax_rm = value;
- this.NotifyPropertyChanged();
- }
- }
- public double Pertamax_pnbp
- {
- get { return pertamax_pnbp; }
- set
- {
- pertamax_pnbp = value;
- this.NotifyPropertyChanged();
- }
- }
- private double solar;
- private double solar_rm;
- private int solar_pnbp;
- public double Solar
- {
- get { return solar; }
- set
- {
- solar = value;
- this.NotifyPropertyChanged();
- }
- }
- public double Solar_rm
- {
- get { return solar_rm; }
- set
- {
- solar_rm = value;
- this.NotifyPropertyChanged();
- }
- }
- public int Solar_pnbp
- {
- get { return solar_pnbp; }
- set
- {
- solar_pnbp = value;
- this.NotifyPropertyChanged();
- }
- }
- public StatistikInfobekumLanjutanViewModel()
- {
- Data = new ObservableCollection<Book>();
- FillData();
- FillPertamax();
- //FillSolar();
- }
- async void FillPertamax()
- {
- using (UserDialogs.Instance.Loading("loading..."))
- {
- var content = await ApiServices.ServiceClientInstance.GetPertamax(2020);
- if (content != null)
- {
- Pertamax = content.data.pertamax;
- Pertamax_rm = content.data.rm;
- Pertamax_pnbp = content.data.pnbp;
- }
- else
- {
- await Application.Current.MainPage.DisplayAlert("Error", "Data Kosong Atau Kesalahan Dalam Pengambilan Data", "OK");
- }
- }
- }
- async void FillSolar()
- {
- using (UserDialogs.Instance.Loading("loading..."))
- {
- var content = await ApiServices.ServiceClientInstance.GetSolar(2020);
- if (content != null)
- {
- Solar = content.data.solar;
- Solar_rm = content.data.rm;
- Solar_pnbp = content.data.pnbp;
- }
- else
- {
- await Application.Current.MainPage.DisplayAlert("Error", "Data Kosong Atau Kesalahan Dalam Pengambilan Data", "OK");
- }
- }
- }
- private void FillData()
- {
- Book obj = new Book() { name = "Lemdiklat", qty = 23, target = 15 };
- Data.Add(obj);
- Book obj2 = new Book() { name = "Labfor", qty = 26, target = 11 };
- Data.Add(obj2);
- Book obj3 = new Book() { name = "Bareskrim", qty = 20, target = 29 };
- Data.Add(obj3);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment