public CommonCodeModel(CommonCode commonCode) { this.Id = commonCode.Id; this.ParentId = 0; if (commonCode.Parent != null) { this.ParentId = commonCode.Parent.Id; } this.Name = commonCode.Name; this.FullName = commonCode.FullNameString(); this.CodeNo = commonCode.CodeNo; this.ParamString = commonCode.ParamString; this.ParamFlag = commonCode.ParamFlag; this.ParamDecimal = commonCode.ParamDecimal; this.Note = commonCode.Note; }