Example #1
0
        public ActionResult AdminEdit(CalendarEntryDisplayModel model)
        {
            using (var context = new DasKlubDbContext())
            {
                var entry = context.CalendarContestEntry.First(item => item.CalendarContestEntryId == model.CalendarContestEntryId);

                entry.IsApproved = model.IsApproved;

                context.Entry(entry).State = EntityState.Modified;

                context.SaveChanges();

                return View(model);
            }
        }
Example #2
0
        public ActionResult AdminEdit(int id)
        {
            using (var context = new DasKlubDbContext())
            {
                var entry = context.CalendarContestEntry.First(item => item.CalendarContestEntryId == id);

                var model = new CalendarEntryDisplayModel();

                model.IsApproved = entry.IsApproved;
                model.CalendarContestEntryId = entry.CalendarContestEntryId;
                model.ModelName = entry.ModelName;
                model.PhotographerName = entry.PhotographerName;
                model.EntryPhotoUrlPreview = Utilities.S3ContentPath(entry.EntryPhotoKeyPreview);
                model.EntryPhotoUrlRaw = Utilities.S3ContentPath(entry.EntryPhotoKeyRaw);
                model.EntryPhotoUrlThumb = Utilities.S3ContentPath(entry.EntryPhotoKeyThumb);
                model.ProofPhotoUrlPreview = Utilities.S3ContentPath(entry.ProofPhotoKeyPreview);
                model.ProofPhotoUrlRaw = Utilities.S3ContentPath(entry.ProofPhotoKeyRaw);
                model.ProofPhotoUrlThumb = Utilities.S3ContentPath(entry.ProofPhotoKeyThumb);

                return View(model);
            }
        }