Пример #1
0
        public ExamModel InsertExam(ExamModel model)
        {
            //if (model.Shift != null && model.ShiftId == 0)
            //{
            //  model.Shift.CreatedById = model.CreatedById;
            //  model.Shift.CreatedDate = model.CreatedDate;
            //  model.Shift.LastModifiedById = model.LastModifiedById;
            //  model.Shift.LastModifiedDate = model.LastModifiedDate;
            //  var shift = _shifts.InsertShift(model.Shift);
            //  model.ShiftId = shift.Id;
            //}

            var inserted = _repo.Insert(model);

            return(GetExam(inserted.Id));
        }
Пример #2
0
 public IActionResult Post([FromBody] ExamModel model)
 {
     return(Post(_service.InsertExam, AuditNew(model)));
 }
Пример #3
0
 public IActionResult Put(int id, [FromBody] ExamModel model)
 {
     return(Put(_service.UpdateExam, AuditExisting(model)));
 }
Пример #4
0
        public ExamModel UpdateExam(ExamModel model)
        {
            var updated = _repo.Update(model);

            return(GetExam(updated.Id));
        }