public override async void Execute(object parameter)
        {
            var response = await this.ExecuteAsync((int)parameter);

            if (response.Status == Status.Error)
            {
                RecipeMessageBox.Show("Error occured");
                return;
            }

            RecipeMessageBox.Show("Profile is successfully approved");

            var service = new LoadUnapprovedPharmacyAdminsService(this.viewModel);
            await service.Load();
        }
예제 #2
0
        private async void MyApprovalsButton_Click(object sender, RoutedEventArgs e)
        {
            if (User.Default.CurrentProfile == "hospital_director")
            {
                this._navigationService.Navigate(ref this._hospitalAdminApprovals);

                var vm = (HospitalAdminApprovalViewModel)this._hospitalAdminApprovals.DataContext;

                var service = new LoadHospitalAdminApprovalsService(vm);

                await service.Load();
            }
            else if (User.Default.CurrentProfile == "pharmacy_admin")
            {
                this._navigationService.Navigate(ref this._pharmacyAdminApprovals);

                var vm = (PharmacyAdminApprovalsViewModel)this._pharmacyAdminApprovals.DataContext;

                var service = new LoadPharmacyAdminApprovalsService(vm);

                await service.Load();
            }
            else
            {
                this._navigationService.Navigate(ref this._ministryWorkerApprovals);

                var vm = (MinistryWorkerApprovalsViewModel)this._ministryWorkerApprovals.DataContext;

                var pharmacyAdminsService = new LoadUnapprovedPharmacyAdminsService(vm);

                await pharmacyAdminsService.Load();

                var hospitalAdminsService = new LoadUnapprovedHospitalAdminsService(vm);

                await hospitalAdminsService.Load();
            }
        }