public ActionResult CodeItemEntry(CodeItemEntryDTO CodeItemDTO) { CodeDescription editObj = null; if (CodeItemDTO.Id > 0) { editObj = this.codeContext.CodeDescriptions.First(c => c.Id == CodeItemDTO.Id); } else { editObj = new CodeDescription(); this.codeContext.CodeDescriptions.Add(editObj); } editObj.Code = CodeItemDTO.Code; editObj.Message = CodeItemDTO.Message; editObj.Description = CodeItemDTO.Desc; editObj.CodeTypeId = CodeItemDTO.typeId; editObj.ModuleId = CodeItemDTO.moduleId; this.codeContext.SaveChanges(); return(Ok(editObj?.Id ?? -1)); }
private static IvidCodePair BuildIvidCodePair(CodeDescription description) { return description == null ? new IvidCodePair(string.Empty, string.Empty) : new IvidCodePair(description.code, description.description); }
public virtual bool Equals(CodeDescription obj) { return(obj != null && string.Equals(obj.Code, Code)); }