Ejemplo n.º 1
0
        public Submission(User submitter, SubmissionViewModel input, CallForSpeakers callForSpeakers)
        {
            Submitter = submitter;
            CallForSpeakers = callForSpeakers;
            Title = input.Title;
            Abstract = input.Abstract;
            Status = Submitted;

            SpeakerName = input.SpeakerName;
            SpeakerBio = input.SpeakerBio;
            SpeakerEmail = input.SpeakerEmail;
            SpeakerPhone = input.SpeakerPhone;
            SpeakerTwitter = input.SpeakerTwitter;
            SpeakerImageUrl = input.SpeakerImageUrl;
        }
Ejemplo n.º 2
0
        public ActionResult ProcessSubmission(User user, SubmissionViewModel input)
        {
            if (ModelState.IsValid)
            {
                using (var db = new DataContext(user))
                {
                    var found = db.CallsForSpeakers.Find(input.CallForSpeakersId);
                    if (found == null)
                    {
                        Error("There was a problem submitting this session");
                        return RedirectToAction("Index", "Home", new {area = ""});
                    }
                    var submission = new Submission(user, input, found);
                    db.Submissions.Add(submission);
                    db.SaveChanges();
                }

                Success("Successfully submitted session");
                return RedirectToAction("Index", "Home", new { area = "" });
            }
            return View("Create");
        }