public async Task <IActionResult> GetSponsor(int id)
        {
            var sponsor = await _sponsorRepo.GetSponsor(id);

            if (sponsor == null)
            {
                return(NotFound());
            }

            var sponsorResource = _mapper.Map <Sponsor, SponsorResource>(sponsor);

            return(Ok(sponsorResource));
        }
Exemplo n.º 2
0
        public ActionResult Edit(int sponsorId, int conferenceId)
        {
            var sponsor = _repository.GetSponsor(sponsorId);

            if (sponsor == null)
            {
                sponsor = new Sponsor()
                {
                    ConferenceId = conferenceId
                };
            }
            DotNetNuke.Framework.ServicesFramework.Instance.RequestAjaxAntiForgerySupport();
            return(View(sponsor.GetSponsorBase()));
        }
 public async Task <Sponsor> GetSponsor(Guid sponsorId)
 {
     try
     {
         return(await _sponsorRepository.GetSponsor(sponsorId));
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
        public HttpResponseMessage Reorder(int conferenceId)
        {
            var raw  = new StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd();
            var data = JsonConvert.DeserializeObject <List <Order> >(raw);
            ISponsorRepository _repository = SponsorRepository.Instance;

            foreach (Order no in data)
            {
                var sponsor = _repository.GetSponsor(no.id);
                if (sponsor != null)
                {
                    sponsor.ViewOrder = no.order;
                    _repository.UpdateSponsor(sponsor.GetSponsorBase(), UserInfo.UserID);
                }
            }
            return(Request.CreateResponse(HttpStatusCode.OK, ""));
        }
Exemplo n.º 5
0
        public SponsorLogo Get(int sponsorId)
        {
            var sponsor = sponsorRepository.GetSponsor(sponsorId);

            return(new SponsorLogo(sponsor.Logo, "image/png"));
        }
Exemplo n.º 6
0
        public ActionResult Delete(int id)
        {
            var sponsor = sponsorRepository.GetSponsor(id);

            return(sponsor == null ? (ActionResult)HttpNotFound() : View(sponsor));
        }