Пример #1
0
        public ActionResult Delete(int id)
        {
            try
            {
                service.DeleteSponsor(id);

                return RedirectToAction("Index");
            }
            catch
            {
                var sponsor = service.GetSponsor(id);

                Sponsor model = new Sponsor()
                {
                    ID = sponsor.ID,
                    EventID = sponsor.EventID,
                    Name = sponsor.Name,
                    Description = sponsor.Description,
                    SponsorshipLevel = sponsor.SponsorshipLevel,
                    WebsiteUrl = sponsor.WebsiteUrl,
                };

                return View("Details", model);
            }
        }
Пример #2
0
        public ActionResult Create(Sponsor sponsor)
        {
            try
            {
                service.CreateSponsor(new CC.Service.Webhost.Services.Sponsor()
                {
                    EventID = sponsor.EventID,
                    Name = sponsor.Name,
                    Description = sponsor.Description,
                    SponsorshipLevel = sponsor.SponsorshipLevel,
                    WebsiteUrl = sponsor.WebsiteUrl,
                    Image = ConvertToByes(Request.Files["Logo"])
                });

                return RedirectToAction("Index");
            }
            catch (Exception)
            {
                return View(sponsor);
            }
        }
Пример #3
0
        //
        // GET: /Sponsor/Details/5
        public ActionResult Details(int id)
        {
            var sponsor = service.GetSponsor(id);

            Sponsor model = new Sponsor()
            {
                ID = sponsor.ID,
                EventID = sponsor.EventID,
                Name = sponsor.Name,
                Description = sponsor.Description,
                SponsorshipLevel = sponsor.SponsorshipLevel,
                WebsiteUrl = sponsor.WebsiteUrl,
            };

            return View(model);
        }
Пример #4
0
        public ActionResult Create(int eventid)
        {
            Sponsor model = new Sponsor() { EventID = eventid };

            return View(model);
        }
Пример #5
0
        public ActionResult Edit(int id)
        {
            var sponsor = service.GetSponsor(id);

            Sponsor model = new Sponsor()
            {
                ID = sponsor.ID,
                EventID = sponsor.EventID,
                Name = sponsor.Name,
                Description = sponsor.Description,
                SponsorshipLevel = sponsor.SponsorshipLevel,
                WebsiteUrl = sponsor.WebsiteUrl,
                Logo = sponsor.Image == null ? null : new Infrastructure.WebImageOCC(sponsor.Image),
            };

            return View(model);
        }