Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("RefAssessmentTypeId,AssessmentTypeCode,AssessmentType")] RefAssessmentType refAssessmentType)
        {
            if (id != refAssessmentType.RefAssessmentTypeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(refAssessmentType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RefAssessmentTypeExists(refAssessmentType.RefAssessmentTypeId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }

                TempData["messageType"]  = "success";
                TempData["messageTitle"] = "RECORD UPDATED";
                TempData["message"]      = "Record successfully updated";

                return(RedirectToAction(nameof(Index)));
            }
            return(View(refAssessmentType));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("RefAssessmentTypeId,AssessmentTypeCode,AssessmentType")] RefAssessmentType refAssessmentType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(refAssessmentType);
                await _context.SaveChangesAsync();

                TempData["messageType"]  = "success";
                TempData["messageTitle"] = "RECORD CREATED";
                TempData["message"]      = "New record successfully created";

                return(RedirectToAction(nameof(Index)));
            }
            return(View(refAssessmentType));
        }