예제 #1
0
        public async Task <JsonResult> GetHotels()
        {
            List <Hotel> hotels = await YummyOnlineManager.GetHotels();

            hotels.AddRange(await YummyOnlineManager.GetHotelReadyForConfirms());

            if (User.IsInRole(nameof(Role.SuperAdmin)))
            {
                return(Json(hotels.Select(p => new {
                    p.Id,
                    p.Name,
                    p.ConnectionString,
                    p.AdminConnectionString,
                    p.CssThemePath,
                    p.OrderSystemStyle,
                    p.CreateDate,
                    p.Tel,
                    p.Address,
                    p.OpenTime,
                    p.CloseTime,
                    p.Usable
                })));
            }
            return(Json(hotels.Select(p => new {
                p.Id,
                p.Name,
                p.ConnectionString,
                p.CssThemePath,
                p.OrderSystemStyle,
                p.CreateDate,
                p.Tel,
                p.Address,
                p.OpenTime,
                p.CloseTime,
                p.Usable
            })));
        }