示例#1
0
        public ActionResult Index()
        {
            User user = (User)Session["users"];

            if (user == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            NH.NHibernateOperation operation = new NH.NHibernateOperation();

            IList <Task> tasks   = operation.GetUserTasks(user);
            List <int>   numbers = new List <int>();

            foreach (Task t in tasks)
            {
                numbers.Add(t.Id_position.Id_position);
            }

            IList <Position> positions = operation.GetUserPositions(numbers);

            Dictionary <Position, IList <Flow> > map = new Dictionary <Position, IList <Flow> >();

            foreach (Position p in positions)
            {
                map.Add(p, operation.GetUserActiveFlows(p));
            }
            TaskModel task = new TaskModel();

            task.Map     = map;
            ViewBag.Task = task;

            //List<string[]> list = parser.Condition(cond);


            return(View());
        }