Exemplo n.º 1
0
        public ActionResult BindForm(string keyValue, int indexType)
        {
            if (indexType != 0)//为1则是安卓终端的指标配置
            {
                return(RedirectToAction("TerminalBindForm", new { keyValue, indexType }));
            }
            Operator   user       = OperatorProvider.Provider.Current();
            DataSetBLL dataSetBLL = new DataSetBLL();
            var        indexlist  = dataSetBLL.GetList(null).Where(p => p.IsOpen == 1).ToList(); //所有的指标
            //查找所有的关联关系
            IIndexAssocationBLL          indexAssocationBLL = new IIndexAssocationBLL();
            List <IndexAssocationEntity> indices            = indexAssocationBLL.GetList(user.DeptId);
            //查询未被其他标题绑定的指标
            var BindIds     = indices.Where(x => x.TitleId != keyValue).Select(p => p.DataSetId); //非当前标题 已经的被帮的指标
            var thisBindIds = indices.Where(x => x.TitleId == keyValue).Select(p => p.DataSetId); //当前标题绑定的指标
            var data        = indexlist.Where(x => !BindIds.Contains(x.Id)).ToList();             //当前标题 可显示的指标

            ViewBag.ChceckIds = thisBindIds.ToList();
            ViewBag.TitleId   = keyValue;
            return(View(data));
        }