public void AddUnique(OrderCommentLog attemptOrderCommentLog) { foreach (OrderCommentLog orderCommentLog in this) { if (attemptOrderCommentLog.OrderCommentLogId == orderCommentLog.OrderCommentLogId) { return; } } this.Add(attemptOrderCommentLog); }
public OrderCommentLog LogOrderComment(int specimenLogId, string masterAccessionNo, string comment, YellowstonePathology.Business.User.SystemIdentity systemIdentity, YellowstonePathology.Business.Domain.OrderComment orderComment) { YellowstonePathology.Business.Domain.OrderCommentLog orderCommentLog = new OrderCommentLog(); orderCommentLog.OrderCommentId = orderComment.OrderCommentId; orderCommentLog.SpecimenLogId = specimenLogId; orderCommentLog.MasterAccessionNo = masterAccessionNo; orderCommentLog.Comment = comment; orderCommentLog.Description = orderComment.Description; orderCommentLog.LoggedById = systemIdentity.User.UserId; orderCommentLog.LoggedBy = systemIdentity.User.DisplayName; orderCommentLog.StationName = System.Environment.MachineName; orderCommentLog.LogDate = DateTime.Now; orderCommentLog.OrderCommentLogId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); this.Add(orderCommentLog); return(orderCommentLog); }
public static void LogEvent(string clientOrderId, string comment, YellowstonePathology.Business.User.SystemUser systemUser, YellowstonePathology.Business.Domain.OrderCommentEnum eventEnum) { OrderCommentLogCollection orderCommentLogCollection = new OrderCommentLogCollection(); YellowstonePathology.Business.Interface.IOrderComment eventInfo = YellowstonePathology.Business.Domain.OrderCommentFactory.GetOrderComment(eventEnum); string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); OrderCommentLog eventLog = new OrderCommentLog(objectId); eventLog.FromEvent(eventInfo); eventLog.ClientOrderId = clientOrderId; eventLog.Comment = comment; eventLog.LoggedById = systemUser.UserId; eventLog.LoggedBy = systemUser.DisplayName; eventLog.LogDate = DateTime.Now; orderCommentLogCollection.Add(eventLog); }