/// <summary>
        /// Get all WorkflowNavigations
        /// </summary>
        /// <returns>List of WorkflowNavigation</returns>
        public async Task <List <WorkflowNavigationViewModel> > GetAll()
        {
            List <string> list = new List <string> {
                "WorkflowId"
            };
            var para = APIProvider.APIDefaultParameter(list, 0);

            var source = await _workflowNavigation.Query(para);

            List <WorkflowNavigationViewModel> dest = Mapper.Map <List <WorkflowNavigationViewModel> >(source);

            //short k = 2;
            //GetWorkflowList(dest, dest.FirstOrDefault().WorkflowStateId);
            return(dest);
        }
Ejemplo n.º 2
0
        public async Task <List <WorkflowStateViewModel> > GetStateNavigation(byte id)
        {
            List <string> list = new List <string> {
                "WorkflowId"
            };
            var para = APIProvider.APIDefaultParameter(list, 0);
            IEnumerable <WorkflowNavigation> listNav = await _workflowNavigationRepo.Query(para);

            list = new List <string> {
                "Id", "WorkflowId"
            };
            para = APIProvider.APIDefaultParameter(list, 0, id);
            IEnumerable <WorkflowState> listFlow = await _workflowStateRepo.Query(para);

            List <WorkflowState> source = new List <WorkflowState>();

            foreach (var item in listFlow)
            {
                if (item.IsFirst == true || (listNav.FirstOrDefault(a => a.NextWorkflowStateId == item.Id) != null))
                {
                    source.Add(item);
                }
            }

            List <WorkflowStateViewModel> dest = Mapper.Map <List <WorkflowStateViewModel> >(source);

            return(dest);
        }