private async void LoadDetailPreConfirmNewCoordination(ResponsePreConfirmNewMedicalCenterCoordination response) { IMedicalCenterCoordinationPageViewModel medicalCenterCoordinationPageViewModel = ServiceLocator.Current.GetInstance <IMedicalCenterCoordinationPageViewModel>(); if (response.PreConfirm != null) { PreCoordination = new CoordinationViewModel { Address = MedicalCenterSelected.Address, AgendaName = ServiceSelected.Name, ClinicCode = MedicalCenterSelected.ClinicCode, ClinicName = MedicalCenterSelected.ClinicName, Date = ScheduleSelected.Date, Document = PersonSelected.Document, FullAddress = string.Format("{0} - {1}", MedicalCenterSelected.ClinicName, response.PreConfirm.ClinicAddress), Hour = ScheduleSelected.Time, IsVisiblePay = true, IsVisibleRecommendation = false, Latitude = double.Parse((response.PreConfirm.Latitude.Replace(".", phoneService.CurrentCulture.NumberFormat.CurrencyDecimalSeparator))), Longitude = double.Parse((response.PreConfirm.Longitude.Replace(".", phoneService.CurrentCulture.NumberFormat.CurrencyDecimalSeparator))), Names = PersonSelected.Names, NameSpecialty = SpecialitySelected.Description, Price = response.PreConfirm.Price, RDACode = MedicalCenterSelected.RDACode, SpecialityCode = SpecialitySelected.Code, Time = ScheduleSelected.Time, TitleButton = response.PreConfirm.Price == "0.0" ? AppResources.TitleConfirmNewCoordination : AppResources.TitlePay, TypeCoordination = SpecialitySelected.Description, YearMonthDay = ScheduleSelected.YearMonthDay }; medicalCenterCoordinationPageViewModel.CoordinationSelected = PreCoordination; await navigationService.Navigate(AppPages.MedicalCenterCoordinationDetailPage); } }
public MedicalCenterCoordinationDetailPage() { InitializeComponent(); if (Device.iOS == Device.RuntimePlatform) { NavigationPage.SetTitleIcon(this, AppConfigurations.IconNavigationBar); } pendingCoordination = (MedicalCenterCoordinationPageViewModel)BindingContext; CoordinationSelected = pendingCoordination.CoordinationSelected; map = new ExtendedMap(MapSpan.FromCenterAndRadius(new Position(CoordinationSelected.Latitude, CoordinationSelected.Longitude), Distance.FromKilometers(1))) { IsShowingUser = CrossGeolocator.Current.IsGeolocationAvailable && CrossGeolocator.Current.IsGeolocationEnabled, ItemsSource = new List <ClinicViewModel>() { new ClinicViewModel() { Icon = "gps", HasInteraction = false, Latitude = CoordinationSelected.Latitude, Longitude = CoordinationSelected.Longitude, Name = CoordinationSelected.ClinicName, } } }; frameMap.Content = map; pendingCoordination.PropertyChanged += pendingCoordinationPropertyChanged; }
private void LoadPendingCoordinations(ResponsePendingCoordinations responsePendingCoordinations) { Coordinations = new ObservableCollection <CoordinationViewModel>(); foreach (PendingCoordination coordination in responsePendingCoordinations.PendingCoordinations) { CoordinationViewModel coordinationViewModel = new CoordinationViewModel(); ViewModelHelper.SetCoordinationToCoordinationViewModel(coordinationViewModel, coordination, phoneService.CurrentCulture.NumberFormat.CurrencyDecimalSeparator); Coordinations.Add(coordinationViewModel); } }
/// <summary> /// 显示协调信息 /// </summary> /// <param name="orderId"></param> internal static void ShowCoordination(string orderId) { var window = new CoordinationWindow { Owner = Application.Current.MainWindow }; var vm = new CoordinationViewModel(); vm.LoadOrderInfo(orderId); window.DataContext = vm; vm.Initialize(); window.ShowDialog(); window.DataContext = null; }
public MedicalCenterCoordinationPageViewModel( IApiService apiService, IDialogService dialogService, IPhoneService phoneService, INavigationService navigationService) { this.apiService = apiService; this.dialogService = dialogService; this.phoneService = phoneService; this.navigationService = navigationService; IsVisiblePay = false; AllCoordinations = new List <CoordinationViewModel>(); Coordinations = new ObservableCollection <CoordinationViewModel>(); CoordinationSelected = new CoordinationViewModel(); }
internal static void SetCoordinationToCoordinationViewModel(CoordinationViewModel viewModel, PendingCoordination model, string decimalSeparator) { viewModel.Address = model.MedicalCenter.Address; viewModel.AgendaName = model.AgendaName; viewModel.ClinicCode = model.MedicalCenter.ClinicCode; viewModel.RDACode = model.RDACode; viewModel.SpecialityCode = model.SpecialityCode; viewModel.Latitude = double.Parse(model.MedicalCenter.Latitude.Replace(".", decimalSeparator)); viewModel.Longitude = double.Parse(model.MedicalCenter.Longitude.Replace(".", decimalSeparator)); viewModel.Day = model.Day; viewModel.Document = model.Document; viewModel.FullAddress = string.Format("{0} - {1}", model.MedicalCenter.ClinicName, model.MedicalCenter.Address); viewModel.Date = model.Date; viewModel.Hour = model.Time; viewModel.ClinicName = model.MedicalCenter.ClinicName; viewModel.Names = model.Names; viewModel.NameSpecialty = model.SpecialityName; viewModel.TypeCoordination = model.AgendaType; viewModel.YearMonthDay = model.YearMonthDay; viewModel.Time = model.Time; viewModel.Recommendations = model.Recommendations; viewModel.Price = model.Price; }