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 Domain.OrderComment GetLabEventByEventId(int orderCommentId) { Domain.OrderComment result = new Domain.OrderComment(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "SELECT * from tblOrderComment where OrderCommentId = @OrderCommentId"; cmd.CommandType = System.Data.CommandType.Text; cmd.Parameters.Add("@OrderCommentId", System.Data.SqlDbType.Int).Value = orderCommentId; using (SqlConnection cn = new SqlConnection(Properties.Settings.Default.ProductionConnectionString)) { cn.Open(); cmd.Connection = cn; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { result = new YellowstonePathology.Business.Domain.OrderComment(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(result, dr); sqlDataReaderPropertyWriter.WriteProperties(); } } } return result; }