Ejemplo n.º 1
0
 public IdentityController(IPasswordResetCommandHandler passwordResetCommandHandler,
                           ICreateNewApplicationUserCommandHandler createNewApplicationUserCommandHandler,
                           IOptions <AppSettingsSingleton> appSettings, ILoginCommandHandler loginCommandHandler,
                           IApplicationUserRepository applicationUserRepository)
 {
     _passwordResetCommandHandler            = passwordResetCommandHandler;
     _createNewApplicationUserCommandHandler = createNewApplicationUserCommandHandler;
     _loginCommandHandler       = loginCommandHandler;
     _applicationUserRepository = applicationUserRepository;
     _appSettings = appSettings.Value;
 }
Ejemplo n.º 2
0
 async void OnCancelTapped(object sender, EventArgs e)
 {
     var label    = (RegistrationEventLabel)sender;
     var response = await ApiService.Instance.GetDataFromServerTask <SheduleRequestModel, AppointmentMobileResponseModel>(new SheduleRequestModel
     {
         RegistrationEventId = label.RegistrationEventId.ToString(),
         ProgramId           =
             AppSettingsSingleton.GetInstance().GetByKey(AppSettingName.ProgramId, string.Empty),
         ParticipantId =
             AppSettingsSingleton.GetInstance().GetByKey(AppSettingName.ParticipantId, string.Empty)
     }, ApiConstants.CancelAppointmentUrl);
 }
        public async Task InitHealthReportSectionPage()
        {
            ResponseContent = await ApiService.Instance.GetDataFromServerTask <PhrRequestModel, PhrSectionResponseModel>(new PhrRequestModel()
            {
                ProgramId     = AppSettingsSingleton.GetInstance().GetByKey(AppSettingName.ProgramId, string.Empty),
                ParticipantId =
                    AppSettingsSingleton.GetInstance().GetByKey(AppSettingName.ParticipantId, string.Empty),
                SectionId = Section.Id
            }, ApiConstants.GetSingleSectionMobileUrl);

            HealthReportContentView.Source = new HtmlWebViewSource {
                Html = ResponseContent.Html
            };
        }
 private async void Button_Clicked(object sender, EventArgs e)
 {
     if (isTimeAlreadyChosen)
     {
         var response = await ApiService.Instance.GetDataFromServerTask <SheduleRequestModel, AppointmentMobileResponseModel>(new SheduleRequestModel
         {
             RegistrationEventId = this.RegistrationEventId,
             ProgramId           =
                 AppSettingsSingleton.GetInstance().GetByKey(AppSettingName.ProgramId, string.Empty),
             ParticipantId =
                 AppSettingsSingleton.GetInstance().GetByKey(AppSettingName.ParticipantId, string.Empty)
         }, ApiConstants.CancelAppointmentUrl);
     }
     OnAlertYesNoClicked(sender, e);
 }
        public async Task InitPage()
        {
            var response = await ApiService.Instance.GetDataFromServerTask <HomeDataRequestModel, WelcomeLetterResponseModel>(new HomeDataRequestModel()
            {
                ProgramId     = AppSettingsSingleton.GetInstance().GetByKey(AppSettingName.ProgramId, string.Empty),
                ParticipantId = AppSettingsSingleton.GetInstance().GetByKey(AppSettingName.ParticipantId, string.Empty)
            }, ApiConstants.WelcomeLetterUrl);

            if (response != null)
            {
                var htmlSource = new HtmlWebViewSource {
                    Html = response.WelcomeLetter
                };

                WelcomLetterWebView.Source = htmlSource;
                StackWebView.Opacity       = 1;
            }
        }
        public async Task ListViewAttemp()
        {
            var response =
                await
                ApiService.Instance.GetDataFromServerTask <HomeDataRequestModel, SheduleResponseModel>(
                    new SheduleRequestModel
            {
                ProgramId =
                    AppSettingsSingleton.GetInstance().GetByKey(AppSettingName.ProgramId, string.Empty),
                ParticipantId =
                    AppSettingsSingleton.GetInstance().GetByKey(AppSettingName.ParticipantId, string.Empty),
                RegistrationEventId = RegistrationEventId
            }, ApiConstants.ShedulePageUrl);

            Title = response.RegistrationEventName;

            opps = new ObservableCollection <MySheduleModel>();

            SheduleLayout.IsVisible = (bool)response?.ScreeningPeriods?.Select(args => args.ScreeningSubPeriods).Any();

            foreach (var screeningSubPeriod in response.ScreeningPeriods)
            {
                var sheduleModel = new MySheduleModel {
                    Title = screeningSubPeriod.Location
                };

                foreach (var subPeriod in screeningSubPeriod.ScreeningSubPeriods.Where(args => args.Active == 1))
                {
                    sheduleModel.ShedulePlans.Add(new ShedulePlan
                    {
                        isEnabled            = subPeriod.Full == 0,
                        ScreeningTimeTitle   = subPeriod.ScreeningTime,
                        ScreeningSubperiodId = subPeriod.ScreeningSubPeriodId,
                        BAlreadyRegistered   = subPeriod.BAlreadyRegistered
                    });
                }

                opps.Add(sheduleModel);
            }

            foreach (var mySheduleModel in opps)
            {
                SheduleLayout.Children.Add(CreateGridHeader(mySheduleModel.Title));

                var listEventsView             = new List <IList <View> >();
                var firstListEventsViewColumn  = new List <View>();
                var secondListEventsViewColumn = new List <View>();
                var thirdListEventsViewColumn  = new List <View>();

                for (int i = 0; i < mySheduleModel.ShedulePlans.Count; i += 3)
                {
                    firstListEventsViewColumn.Add(CreateGridCellBody(mySheduleModel.ShedulePlans[i].ScreeningTimeTitle, mySheduleModel.ShedulePlans[i].isEnabled, mySheduleModel.ShedulePlans[i].ScreeningSubperiodId, mySheduleModel.ShedulePlans[i].BAlreadyRegistered));
                }

                for (int y = 1; y < mySheduleModel.ShedulePlans.Count; y += 3)
                {
                    try
                    {
                        secondListEventsViewColumn.Add(
                            CreateGridCellBody(mySheduleModel.ShedulePlans[y].ScreeningTimeTitle,
                                               mySheduleModel.ShedulePlans[y].isEnabled, mySheduleModel.ShedulePlans[y].ScreeningSubperiodId, mySheduleModel.ShedulePlans[y].BAlreadyRegistered));
                    }
                    catch (Exception)
                    {
                    }
                }
                for (int u = 2; u < mySheduleModel.ShedulePlans.Count; u += 3)
                {
                    try
                    {
                        thirdListEventsViewColumn.Add(
                            CreateGridCellBody(mySheduleModel.ShedulePlans[u].ScreeningTimeTitle,
                                               mySheduleModel.ShedulePlans[u].isEnabled, mySheduleModel.ShedulePlans[u].ScreeningSubperiodId, mySheduleModel.ShedulePlans[u].BAlreadyRegistered));
                    }
                    catch (Exception)
                    {
                    }
                }

                listEventsView.Add(firstListEventsViewColumn);

                if (secondListEventsViewColumn.Count > 0)
                {
                    listEventsView.Add(secondListEventsViewColumn);
                }

                if (thirdListEventsViewColumn.Count > 0)
                {
                    listEventsView.Add(thirdListEventsViewColumn);
                }

                var eventsGrid = new CustomGrid <View>(listEventsView)
                {
                    GetGrid = { VerticalOptions = LayoutOptions.Fill, BackgroundColor = Color.FromHex("#ffffff") }
                };

                SheduleLayout.Children.Add(eventsGrid.GetGrid);
            }
        }
Ejemplo n.º 7
0
 public Startup(IConfiguration configuration)
 {
     AppSettingsSingleton.Instantiate(configuration);
     RepositoryManager.Configure(AppSettingsSingleton.instance.ORMToUse);
 }