Пример #1
0
        public ActionResult ProjectStatistic()
        {
            DictionaryLogic dictLogic     = new DictionaryLogic();
            var             projectTypes  = dictLogic.GetEnabledDictionaryItems(DictionaryLogic.ProjectType);
            var             projectStatus = dictLogic.GetEnabledDictionaryItems(DictionaryLogic.ProjectStatus);

            StatisticLogic stsLogic = new StatisticLogic();

            ViewBag.TotalHour = stsLogic.GetTotalHour();

            //ForRole
            IUserData user = UserContext.CurrentUser;

            //资讯设计人员
            if (user.HasRole("Consultant"))
            {
                ViewBag.forRole = true;
                var newProjectTypes = new List <DictionaryItem>();
                foreach (DictionaryItem dict in projectTypes)
                {
                    //只能看商业项目和商业项目(转包)
                    if (dict.DictItemId == "101-04" || dict.DictItemId == "101-05")
                    {
                        newProjectTypes.Add(dict);
                    }
                }
                ViewBag.QueryProjectTypes = newProjectTypes;
            }
            else
            {
                ViewBag.forRole           = false;
                ViewBag.QueryProjectTypes = projectTypes;
            }
            ViewBag.QueryProjectStatus = projectStatus;
            return(View());
        }