Ejemplo n.º 1
0
        public async Task <ActionResult> Create([Bind(Include = "PresentationID,PresentationStateID,Observations")] Presentation presentation, HttpPostedFileBase documentFiles)
        {
            if (ModelState.IsValid)
            {
                var requirement = await requirementRepository.FindRequirementByIDAsync(55);

                //presentation.Requirement = requirement;
                presentation.RequirementID = 55;
                presentation.DocumentFiles = await documentFileService.UploadDocumentFileAsync(documentFiles);

                await presentationRepository.CreateAsync(presentation);

                return(RedirectToAction("Index"));

                //db.Presentations.Add(presentation);
                //await db.SaveChangesAsync();
                //return RedirectToAction("Index");
            }

            //ViewBag.PresentationStateID = new SelectList(db.PresentationStates, "PresentationStateID", "Description", presentation.PresentationStateID);
            //ViewBag.RequirementID = new SelectList(db.Requirements, "RequirementID", "RequirementID", presentation.RequirementID);
            return(View(presentation));
        }