Exemple #1
0
        public static YellowstonePathology.Business.Rules.MethodResult AddDailyTaskOrderCytologySlideDisposal(int days)
        {
            YellowstonePathology.Business.Rules.MethodResult result = new Rules.MethodResult();
            YellowstonePathology.Business.Task.Model.TaskCytologySlideDisposal task = new TaskCytologySlideDisposal();
            DateTime actionDate = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetNewestDailyTaskOrderTaskDate(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(days);

            while (actionDate < finalDate)
            {
                string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

                YellowstonePathology.Business.Task.Model.TaskOrderCytologySlideDisposal taskOrder = new YellowstonePathology.Business.Task.Model.TaskOrderCytologySlideDisposal(objectId, actionDate, objectId, systemIdentity);
                taskOrderCollection.Add(taskOrder);
                actionDate = actionDate.AddDays(1);
            }

            //YellowstonePathology.Business.Persistence.DocumentGateway.Instance.SubmitChanges(taskOrderCollection, false);

            actionDate     = actionDate.AddDays(-1);
            result.Message = "Daily Task Order Cytology Slide Disposal have been added through " + actionDate.ToString("MM/dd/yyyy");
            return(result);
        }
        public TaskOrderCytologySlideDisposal(string taskOrderId, DateTime actionDate, string objectId, YellowstonePathology.Business.User.SystemIdentity systemIdentity)
        {
            TaskCytologySlideDisposal taskCytologySlideDisposal = new TaskCytologySlideDisposal();

            this.m_TaskOrderId         = taskOrderId;
            this.m_ObjectId            = objectId;
            this.m_TaskName            = "Cytology Slide Disposal";
            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 = taskCytologySlideDisposal.TaskId;
        }