Example #1
0
        private string GetLozalizedReasons(Appointment appointment)
        {
            string currentCulture = CurentCultureUtils.GetCurrentCulture();

            return(string.Join(", ",
                               appointment.AppointmentReasons.Where(appToReas => appToReas.Reason != null && appToReas.Reason.LangReasonDictionary != null)
                               .Select(appToReas => appToReas.Reason.LangReasonDictionary[currentCulture]).ToList()));
        }
Example #2
0
        public static void RedirectRequests(RewriteContext context)
        {
            var request = context.HttpContext.Request;
            var path    = request.Path.Value;

            var currentCulture = CurentCultureUtils.GetCurrentCulture();

            if (!CurentCultureUtils.SupportedCultures.Contains(path.Split("/")[1]))
            {
                context.HttpContext.Response.Redirect($"/{currentCulture}{ request.Path.Value }");
            }
        }
Example #3
0
        public async Task OnGetAsync()
        {
            if (AvailableDoctors == null)
            {
                var availableDoctors = await _appointmentsService.GetAllAvailableDoctors();

                AvailableDoctors = new SelectList(availableDoctors, nameof(Doctor.UserId), nameof(Doctor.FullName));
            }
            if (AvailableReasons == null)
            {
                var curentCulture = CurentCultureUtils.GetCurrentCulture();
                var reasonFromApi = await _appointmentsService.GetAllAppointmentReasons();

                var reasons = reasonFromApi.Select(reason =>
                                                   new
                {
                    Id    = reason.ReasonId,
                    Value = reason.LangReasonDictionary[curentCulture]
                })
                              .ToList();
                AvailableReasons = new SelectList(reasons, "Id", "Value");
            }
        }