Example #1
0
        public IActionResult GetWorkshop(
            [FromQuery] string apikey,
            [FromHeader(Name = "conference_id")] int conference_id,
            [FromHeader(Name = "jwttoken")] string jwttoken)
        {
            // Permission Level User
            if (this.jwtService.PermissionLevelValid(jwttoken, "user") && this.auth.KeyIsValid(apikey, conference_id))
            {
                List <Workshop>     workshops = this._context.Workshop.Where(ws => ws.ConferenceID == conference_id && !ws.Invalid).ToList();
                List <WorkshopList> wsexport  = new List <WorkshopList>();
                foreach (Workshop ws in workshops)
                {
                    WorkshopList wsexportitem = new WorkshopList
                    {
                        WorkshopID   = ws.WorkshopID,
                        Name         = ws.Name,
                        HostName     = ws.HostName,
                        Place        = ws.Place,
                        Start        = ws.Start,
                        MaxVisitors  = ws.MaxVisitors,
                        MaterialNote = ws.MaterialNote,
                        Overview     = ws.Overview,
                        Topic        = ws.Topic,
                        Applicants   = this._context.Workshop_Application.Where(wa => wa.WorkshopID == ws.WorkshopID && wa.Status == "IsAttendee").ToList().Count
                    };
                    wsexport.Add(wsexportitem);
                }

                return(this.Ok(wsexport));
            }

            return(this.Unauthorized());
        }
Example #2
0
 public static WorkshopQueryUser CreateQueryUser(ulong accountID, WorkshopList listType, WorkshopType type, WorkshopSortOrder order)
 {
     return(new WorkshopQueryUser((uint)accountID, (EUserUGCList)listType, (EUGCMatchingUGCType)type, (EUserUGCListSortOrder)order));
 }