public IHttpActionResult Get(string historyID) { //异常检测 if (string.IsNullOrEmpty(historyID)) { return(BadRequest("请求异常!")); } //获取数据 try { ImageExResponse response = new ImageExResponse(); ImageExamination imageEx = _repository.Get(historyID); response.ImageEx = imageEx; if (imageEx != null) { response.Files = new EFFileUploadRepository().Get("ImageExamination", historyID); } return(Ok(response)); } catch (Exception ex) { LogHelper.WriteError(ex.ToString()); return(BadRequest(ex.Message)); } }
public string Add(ImageExamination imageExam) { var entity = ModelToEntity(imageExam); entity.IMAGEEXAMID = imageExam.ImageExamID == null?System.Guid.NewGuid().ToString() : imageExam.ImageExamID; repository.Insert(entity); return(entity.IMAGEEXAMID); }
public IHttpActionResult Get(string ImageExamID, string HistoryID) { //新增插入 if (!string.IsNullOrEmpty(ImageExamID) && !string.IsNullOrEmpty(HistoryID)) { ImageExamination _model = _repository.Get(HistoryID); if (_model == null) { _model = new ImageExamination(); _model.ImageExamID = ImageExamID; _model.HistoryID = HistoryID; _repository.Add(_model); } } return(Ok("true")); }
private ImageExamination EntityToModel(HR_IMAGEEXAMINATION entity) { if (entity != null) { var model = new ImageExamination() { ImageExamID = entity.IMAGEEXAMID, HistoryID = entity.HISTORYID, CheckType = entity.CHECKTYPE, CheckTime = entity.CHECKTIME, Department = entity.DEPARTMENT, CheckPosition = entity.CHECKPOSITION, ReportContent = entity.REPORTCONTENT, ReportTime = entity.REPORTTIME, ReportDoctor = entity.REPORTDOCTOR, AuditDoctor = entity.AUDITDOCTOR, ImageUrl = entity.REMARK, }; return(model); } return(null); }
private HR_IMAGEEXAMINATION ModelToEntity(ImageExamination model) { if (model != null) { var entity = new HR_IMAGEEXAMINATION() { IMAGEEXAMID = model.ImageExamID, HISTORYID = model.HistoryID, CHECKTYPE = model.CheckType, CHECKTIME = model.CheckTime, DEPARTMENT = model.Department, CHECKPOSITION = model.CheckPosition, REPORTCONTENT = model.ReportContent, REPORTTIME = model.ReportTime, REPORTDOCTOR = model.ReportDoctor, AUDITDOCTOR = model.AuditDoctor, REMARK = model.ImageUrl, }; return(entity); } return(null); }
public bool Edit(ImageExamination imageExam) { var entity = ModelToEntity(imageExam); return(entity != null && repository.Update(entity)); }