示例#1
0
        public async Task<ActionResult> Edit(StudyFieldDegreeViewModel studyFieldDegreeModel)
        {
            _studyFieldDegreeService.Edit(new DomainClasses.StudyFieldDegree
            {
                Id = studyFieldDegreeModel.Id,
                Name = studyFieldDegreeModel.Name
            });

            await _dbContext.SaveChangesAsync();

            return new HttpStatusCodeResult(HttpStatusCode.OK);
        }
示例#2
0
        public async Task<ActionResult> Add(StudyFieldDegreeViewModel studyFieldDegreeModel)
        {
            var studyField = new DomainClasses.StudyFieldDegree
            {
                Id = studyFieldDegreeModel.Id,
                Name = studyFieldDegreeModel.Name
            };

            _studyFieldDegreeService.Add(studyField);

            await _dbContext.SaveChangesAsync();

            return Json(studyField.Id);
        }