Esempio n. 1
0
        public ProjectWorkflowWrapper(ProjectWorkflow workflow,
                                      IUnitsOfWorkContainer unitsOfWork)
        {
            _workflow    = workflow;
            _unitsOfWork = unitsOfWork;

            //Entry Methods Binding
            BindEntryMethods();

            //Exit Methods Binding
            BindExitMethods();

            //Guard For Transitions
            BindGuardMethods();
        }
Esempio n. 2
0
        private ProjectStateManager(Project currentProject, string currentUser, IList <string> roles)
        {
            _currentUser        = currentUser;
            _roles              = roles;
            _investorNotificate = new InvestorNotification();
            _adminNotificate    = new AdminNotification();
            _userNotificationl  = new UserNotification();
            _repository         = RepositoryContext.Current;
            _currentProject     = _repository.GetOne <Project>(p => p._id == currentProject._id);
            _unitsOfWork        = new UnitsOfWorkContainer(_currentProject,
                                                           _repository,
                                                           _userNotificationl,
                                                           _adminNotificate,
                                                           _investorNotificate,
                                                           _currentUser, _roles);
            if (_currentProject == null)
            {
                _currentProject = currentProject;
            }
            if (string.IsNullOrEmpty(_currentProject._id))
            {
                _currentProject._id = ObjectId.GenerateNewId().ToString();
            }

            if (_currentProject.WorkflowState == null)
            {
                _currentProject.WorkflowState = new Workflow
                {
                    CurrentState = ProjectWorkflow.State.Open
                };
            }
            _workflow = new ProjectWorkflowWrapper(new ProjectWorkflow(_currentProject.WorkflowState.CurrentState), _unitsOfWork);

            /*var context = new ProjectStateContext
             * {
             *      UserName = currentUser,
             *      CurrentProject = currentProject,
             *      Roles = roles,
             *      InvestorNotification = _investorNotificate,
             *      UserNotification = _userNotificationl,
             *      AdminNotification = _adminNotificate,
             *      Repository = _repository
             * };
             * var builder = new AttributeStateMachineBuilder();
             * _workflow = new ProjectWorkflowWrapper(
             *      new ProjectWorkflow(
             *              builder.BuilStateMachine<ProjectWorkflow.State,ProjectWorkflow.Trigger>("test", context,_currentProject.WorkflowState.CurrentState)));*/
        }
Esempio n. 3
0
        public void ComissionFixesUoWTest()
        {
            IUnitsOfWorkContainer container = CreateCintainer();

            Assert.IsNotNull(container.ComissionFixesUoW);
        }
Esempio n. 4
0
        public void WaitIspolcomUoWTest()
        {
            IUnitsOfWorkContainer container = CreateCintainer();

            Assert.IsNotNull(container.WaitIspolcomUoW);
        }
Esempio n. 5
0
        public void UnitsOfWorkContainerConstructorTest()
        {
            IUnitsOfWorkContainer target = CreateCintainer();

            Assert.IsNotNull(target);
        }
Esempio n. 6
0
        public void RealizationUoWTest()
        {
            IUnitsOfWorkContainer container = CreateCintainer();

            Assert.IsNotNull(container.RealizationUoW);
        }
Esempio n. 7
0
        public void PlanCreatingUoWTest()
        {
            IUnitsOfWorkContainer container = CreateCintainer();

            Assert.IsNotNull(container.PlanCreatingUoW);
        }
Esempio n. 8
0
        public void OpenUoWTest()
        {
            IUnitsOfWorkContainer container = CreateCintainer();

            Assert.IsNotNull(container.OpenUoW);
        }
Esempio n. 9
0
        public void MinEconomyUoWTest()
        {
            IUnitsOfWorkContainer container = CreateCintainer();

            Assert.IsNotNull(container.MinEconomyUoW);
        }
Esempio n. 10
0
        public void InvolvedorganizationsUoWTest()
        {
            IUnitsOfWorkContainer container = CreateCintainer();

            Assert.IsNotNull(container.InvolvedorganizationsUoW);
        }
Esempio n. 11
0
        public void InvestorApproveUoWTest()
        {
            IUnitsOfWorkContainer container = CreateCintainer();

            Assert.IsNotNull(container.InvestorApproveUoW);
        }
Esempio n. 12
0
        public void DocumentSendingUoWTest()
        {
            IUnitsOfWorkContainer container = CreateCintainer();

            Assert.IsNotNull(container.DocumentSendingUoW);
        }