public int AddResult(ExamineRecord record, ExamineResult result) { var maxId = repository.GetMaxId("HR_EXAMINERESULT", "RESULTID"); var entity = ModelToEntity(result); entity.EXAMID = maxId; entity.CREATEDATE = DateTime.Now; //entity.CreatorUserId repository.Insert(entity); return(maxId); }
private HR_EXAMINERESULT ModelToEntity(ExamineResult model) { if (model != null) { var entity = new HR_EXAMINERESULT() { RESULTID = model.ResultId, EXAMID = model.ExamId, //ITEMCODE = model.ItemCode, RESULT = model.Result }; return(entity); } return(null); }
private ExamineResult EntityToModel(HR_EXAMINERESULT entity) { if (entity != null) { var model = new ExamineResult() { ResultId = entity.RESULTID, ExamId = entity.EXAMID ?? 0, //ItemCode = entity.ITEMCODE, Result = entity.RESULT, //Remark = "" }; return(model); } return(null); }