public static YellowstonePathology.Business.Rules.MethodResult AddDailyTaskOrderPOCReport(int weeks) { YellowstonePathology.Business.Rules.MethodResult result = new Rules.MethodResult(); YellowstonePathology.Business.Task.Model.TaskPOCReport task = new TaskPOCReport(); DateTime actionDate = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetNewestWeeklyTaskOrderTaskDate(task.TaskId); YellowstonePathology.Business.Task.Model.TaskOrderCollection taskOrderCollection = new YellowstonePathology.Business.Task.Model.TaskOrderCollection(); YellowstonePathology.Business.User.SystemIdentity systemIdentity = Business.User.SystemIdentity.Instance; DateTime finalDate = actionDate.AddDays(weeks * 7); while (actionDate < finalDate) { string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString(); YellowstonePathology.Business.Task.Model.TaskOrderPOCReport taskOrder = new YellowstonePathology.Business.Task.Model.TaskOrderPOCReport(objectId, actionDate, objectId, systemIdentity); taskOrderCollection.Add(taskOrder); actionDate = actionDate.AddDays(7); } //YellowstonePathology.Business.Persistence.DocumentGateway.Instance.SubmitChanges(taskOrderCollection, true); actionDate = actionDate.AddDays(-7); result.Message = "Daily Task Order POC Report have been added through " + actionDate.ToString("MM/dd/yyyy"); return(result); }
public TaskOrderPOCReport(string taskOrderId, DateTime actionDate, string objectId, YellowstonePathology.Business.User.SystemIdentity systemIdentity) { TaskPOCReport taskPOCReport = new TaskPOCReport(); this.m_TaskOrderId = taskOrderId; this.m_ObjectId = objectId; this.m_TaskName = "Products of Conception Report"; this.m_OrderedById = systemIdentity.User.UserId; this.m_OrderedByInitials = systemIdentity.User.Initials; this.m_OrderDate = DateTime.Now; this.m_TaskDate = actionDate; this.m_AcknowledgementType = TaskAcknowledgementType.Daily; this.m_TaskId = taskPOCReport.TaskId; }