Example #1
0
        public async Task <ActionResult> Create([Bind(Include = "DocumentationTemplateID,DocumentationTemplateCode,Description,EntityTypeID,DocumentationPeriodicityID")] DocumentationTemplate documentationTemplate)
        {
            if (ModelState.IsValid)
            {
                await documentationTemplateRepository.CreateAsync(documentationTemplate);

                return(RedirectToAction("Index"));
            }

            ViewBag.EntityTypeID = new SelectList(entityTypeRepository.EntityTypes(), "EntityTypeID", "Description", documentationTemplate.EntityTypeID);
            return(View(documentationTemplate));
        }
Example #2
0
        public async Task <ActionResult> Details(int id)
        {
            //if (id == null)
            //{
            //    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            //}
            DocumentationTemplate documentationTemplate = await documentationTemplateRepository.FindDocumentationTemplateByIDAsync(id);

            if (documentationTemplate == null)
            {
                return(HttpNotFound());
            }
            return(View(documentationTemplate));
        }
Example #3
0
        public async Task <ActionResult> Edit(int id)
        {
            //if (id == null)
            //{
            //    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            //}
            DocumentationTemplate documentationTemplate = await documentationTemplateRepository.FindDocumentationTemplateByIDAsync(id);

            if (documentationTemplate == null)
            {
                return(HttpNotFound());
            }

            ViewBag.EntityTypeID = new SelectList(entityTypeRepository.EntityTypes(), "EntityTypeID", "Description", documentationTemplate.EntityTypeID);

            return(View(documentationTemplate));
        }