private void SaveCommers(ClosureLegalReview entity, string action, ProjectCommentStatus status) { //if (status == ProjectCommentStatus.Save) //{ var list = _db.ProjectComment.Where( c => c.CreateUserAccount == ClientCookie.UserCode && c.RefTableId == entity.Id && c.Status == ProjectCommentStatus.Save && c.RefTableName == ClosureLegalReview.TableName && c.SourceCode == FlowCode.Closure).ToList(); if (list.Count > 0) { ProjectComment closureCommens = list[0]; closureCommens.Content = entity.Comments == null ? "" : entity.Comments.Trim(); closureCommens.Status = status; if (entity.ProcInstID.HasValue && entity.ProcInstID.Value > 0) { closureCommens.ProcInstID = entity.ProcInstID; } ProjectComment.Update(closureCommens); } else { AddProjectComment(entity, action, status); } }
private void SaveCommers(ClosureConsInvtChecking entity, string action, ProjectCommentStatus status) { if (status == ProjectCommentStatus.Save) { var list = ProjectComment.Search( c => c.CreateUserAccount == ClientCookie.UserCode && c.RefTableId == entity.Id && c.Action == action && c.RefTableName == ClosureConsInvtChecking.TableName && c.SourceCode == FlowCode.Closure).ToList(); if (list.Count > 0) { ProjectComment closureCommens = list[0]; closureCommens.Content = entity.Comments.Trim(); ProjectComment.Update(closureCommens); } else { AddProjectComment(entity, action, status); } } else { AddProjectComment(entity, action, status); } }