Ejemplo n.º 1
0
        public async Task <IActionResult> OrganizerSave(OrganizerVM model)
        {
            if (model.ID == 0)
            {
                var insertRequest = new OrganizerInsertRequest()
                {
                    Name        = model.Name,
                    CityID      = model.CityID,
                    PhoneNumber = model.PhoneNumber
                };

                await _eventiApi.CreateOrganizerAsync(insertRequest);
            }
            else
            {
                var updateRequest = new OrganizerUpdateRequest()
                {
                    Name        = model.Name,
                    CityID      = model.CityID,
                    PhoneNumber = model.PhoneNumber
                };

                await _eventiApi.UpdateOrganizerAsync(model.ID, updateRequest);
            }

            return(Redirect("/Administrator/Home/Index"));
        }