Esempio n. 1
0
        public async Task <IActionResult> Get()
        {
            var followModel = await _followListService.GetListAsync(GetCurrentLoginUser.CustomerId);

            var stationModel = new JsonListViewModel <StationSimpleInfo>();

            var doctorModel = new JsonListViewModel <DoctorSimpleInfo>();

            if (followModel.FollowStationCount != 0)
            {
                stationModel = await _getInfoService.GetStationsInfosAsync(followModel.FollowStationIds);

                foreach (var item in stationModel.Items)
                {
                    item.IsFollow = true;
                }
            }

            if (followModel.FollowDoctorCount != 0)
            {
                doctorModel = await _getInfoService.GetDoctorsInfosAsync(followModel.FollowDoctorIds);

                foreach (var item in doctorModel.Items)
                {
                    item.IsFollow = true;
                }
            }

            return(PartialView("_pvFollowList", new MyFollowsViewModel
            {
                Doctors = doctorModel.Items,
                Stations = stationModel.Items
            }));
        }
Esempio n. 2
0
        public async Task <IActionResult> Recent()
        {
            var recentModel = await _followListService.GetListAsync(GetCurrentLoginUser.CustomerId);

            var stationModel = new JsonListViewModel <StationSimpleInfo>();

            var doctorModel = new JsonListViewModel <DoctorSimpleInfo>();

            if (recentModel.RecentStationCount != 0)
            {
                stationModel = await _getInfoService.GetStationsInfosAsync(recentModel.RecentStationIds);
            }

            if (recentModel.RecentDoctorCount != 0)
            {
                doctorModel = await _getInfoService.GetDoctorsInfosAsync(recentModel.RecentDoctorIds);
            }

            return(PartialView("_pvRecentList", new MyFollowsViewModel
            {
                Doctors = doctorModel.Items,
                Stations = stationModel.Items
            }));
        }