Ejemplo n.º 1
0
        public async Task AddGathering(string username, string password, GatheringItemIn gathering)
        {
            if (!await Logic.CheckAdmin(Output, username, password))
            {
                throw new Exception("403", new Exception("this request must be made with admin permitions"));
            }
            if (null != await Output.GetFind <Gathering>(x => x.Title == gathering.Title))
            {
                throw new Exception("409", new Exception("A gathering of this title allready exists"));
            }

            var inGathering = gathering.ToData();

            inGathering.MapDataId = await Logic.CityId(Output, gathering.City);

            inGathering.organizerId = (await Logic.Login(Output, username, password)).Id;

            await Input.Add(inGathering);
        }