示例#1
0
        /// <summary>
        /// 根据配置获取页面展示
        /// </summary>
        public List <ActivityCategoryEntity> GetActivityMenu(string userId, string deptId, string module)
        {
            //获取双控数据
            var columnMenu = new TerminalDataSetBLL().GetMenuConfigList(0);
            List <ActivityCategoryEntity> result = new List <ActivityCategoryEntity>();

            if (columnMenu.Count > 0)
            {
                //var code = module == "班组活动" ? "activity" : "education";
                var frist = columnMenu.FirstOrDefault(x => x.ModuleCode == module);
                if (frist != null)
                {
                    //配置的二级菜单
                    var second = columnMenu.Where(x => x.ParentId == frist.ModuleId).OrderBy(x => x.Sort);
                    //创建基础类型的查询实体
                    Dictionary <string, string[]> categoryList = new Dictionary <string, string[]>();

                    #region windows code对照表

                    // 教育培训类型  1.技术讲课   2.技术问答  3.事故预想 4.反事故预想 5.新技术问答  6.新事故预想  7.拷问讲解 8考问讲解(集中式)
                    //教育培训	education
                    //安全技术培训	education_edutrain
                    //技术讲课	education_teach
                    //事故预想	education_expect
                    //反事故演习	education_drill
                    //技术问答	education_qaa
                    //考问讲解  education_qa
                    //安全学习日  education_safeday

                    //班组活动	activity
                    //安全日活动	activity_safeday
                    //政治学习	activity_study
                    //民主管理会	activity_manage
                    //班务会	activity_meet
                    //上级精神宣贯	activity_superior



                    #endregion
                    #region 对照类型
                    foreach (var item in second)
                    {
                        if (item.ModuleCode == "education_edutrain")
                        {
                            continue;
                        }
                        switch (item.ModuleCode)
                        {
                        //教育培训的分类
                        //技术讲课 1
                        case "education_teach":
                            categoryList.Add(item.ModuleCode, new string[] { "1", item.ModuleName });
                            break;

                        //技术问答 2
                        case "education_qaa":
                            categoryList.Add(item.ModuleCode, new string[] { "2", item.ModuleName });
                            break;

                        //事故预想 3
                        case "education_expect":
                            categoryList.Add(item.ModuleCode, new string[] { "3", item.ModuleName });
                            break;

                        //反事故演习 4
                        case "education_drill":
                            categoryList.Add(item.ModuleCode, new string[] { "4", item.ModuleName });
                            break;

                        //拷问讲解 7
                        case "education_qa":
                            categoryList.Add(item.ModuleCode, new string[] { "7", item.ModuleName });
                            break;

                        //安全学习日
                        case "education_safeday":
                            categoryList.Add("EA", new string[] { item.ModuleName });
                            break;

                        //其他活动
                        default:
                            categoryList.Add(item.ModuleCode, new string[] { item.ModuleName });
                            break;
                        }
                    }
                    #endregion

                    result = service.GetMenuIndex(module, userId, deptId, categoryList);
                }
            }

            return(result);
        }