public void SearchData()
        {
            string id = Request["id"].ToString();

            if (!CurrentMaster.IsMain)
            {
                //获取用户查看类型
                string className = GetRequestQueryString("className");//页面类名
                if (!String.IsNullOrEmpty(className))
                {
                    if (!String.IsNullOrEmpty(CurrentMaster.RoleIdList))
                    {
                        CurrentMaster.LookPower = new BllSysMaster().GetLookPower(className, CurrentMaster.RoleIdList, CurrentMaster.Company.Attribute);
                    }
                }

                if (CurrentMaster.LookPower == (int)LookPowerEnum.查看自建)
                {
                    _where = "CreaterId='" + CurrentMaster.Id + "'";//自己查看自己的
                }
            }

            DataSet ds = new BllSysCategory().SearchData(id, _where);
            List <jsonSysCategory> list = new FunTreeCommon().GetTreeBySysCategory(ds);

            WriteJsonToPage(JsonHelper.ToJson(list));
        }
        public void SearchData()
        {
            try
            {
                if (CurrentMaster.Attribute == (int)AdminTypeEnum.系统管理员)
                {
                    //超级管理员查看所有单位
                    _where += " and Attribute=" + (int)CompanyType.单位 + " and Status>" + (int)StatusEnum.除;
                }
                else if (CurrentMaster.Attribute == (int)AdminTypeEnum.单位管理员 || CurrentMaster.Attribute == (int)AdminTypeEnum.供应商管理员 || CurrentMaster.Attribute == (int)AdminTypeEnum.维保公司管理员 || CurrentMaster.Attribute == (int)AdminTypeEnum.消防部门管理员)
                {
                    //查看自己单位
                    _where += " and Attribute=" + (int)CompanyType.单位 + " and Status>" + (int)StatusEnum.除 + " and Id='" + CurrentMaster.Cid + "'";
                }

                _mySet = bll.GetTreeList(_where);
                List <JsonCompanyTree> list = new FunTreeCommon().GetCompanyTreeNodes(_mySet);
                Output = JsonHelper.ToJson(list);
            }
            catch
            {
                Output = "";
            }
            WriteJsonToPage(Output);
        }
Exemple #3
0
        public void SearchProvinceByTree()
        {
            string name = (Request["name"] == null ? "" : Request["name"]); //查询过滤条件

            string where = "";
            if (!string.IsNullOrEmpty(name.Trim()))
            {
                where += "(Name like '%" + name.Trim() + "%' or Code like '%" + name.Trim() + "%')";
            }
            DataSet ds = new BllSysHatProvince().GetTreeList(where);
            List <jsonSysBusinessCircle> list = new FunTreeCommon().GetJsonTree(ds);

            WriteJsonToPage(new JavaScriptSerializer().Serialize(list));
        }
 public void SearchRolesData()
 {
     try
     {
         _where += " and Attribute=" + (int)CompanyType.单位 + " and Status=" + (int)StatusEnum.正常 + " and Id in (select EmployerId from Sys_CompanyCognate where Cid='" + CurrentMaster.Cid + "' and Status=1)";
         _mySet  = bll.GetTreeList(_where);
         List <JsonCompanyTree> list = new FunTreeCommon().GetCompanyTreeNodes(_mySet);
         Output = JsonHelper.ToJson(list);
     }
     catch
     {
         Output = "";
     }
     WriteJsonToPage(Output);
 }
Exemple #5
0
 public void InitMain()
 {
     try
     {
         string typeId = (Request["id"] == null ? "0" : Request["id"]);//左边树形类型
         BllSysFun mybase = new BllSysFun();
         _where += " and Status!="+(int)StatusEnum.删除+" and TypeID=" + typeId;
         _mySet = mybase.GetTreeList(_where);
         List<JsonFunTree> list = new FunTreeCommon().GetFunTreeNodes(_mySet);
         Output =JsonHelper.ToJson(list);
     }
     catch
     {
         Output ="";
     }
     WriteJsonToPage(Output);
 }
 public void SearchPostData()
 {
     try
     {
         if (CurrentMaster.Attribute == (int)AdminTypeEnum.系统管理员)
         {
             //超级管理员查看所有单位
             _where += " and (Attribute>=" + (int)CompanyType.单位 + " and Attribute<=" + (int)CompanyType.部门 + ") and Status=" + (int)StatusEnum.正常;
         }
         else if (CurrentMaster.Attribute == (int)AdminTypeEnum.单位管理员 || CurrentMaster.Attribute == (int)AdminTypeEnum.供应商管理员 || CurrentMaster.Attribute == (int)AdminTypeEnum.维保公司管理员 || CurrentMaster.Attribute == (int)AdminTypeEnum.消防部门管理员)
         {
             //查看自己单位
             _where += " and (Attribute>=" + (int)CompanyType.单位 + " and Attribute<=" + (int)CompanyType.部门 + ") and Status=" + (int)StatusEnum.正常 + " and (Id='" + CurrentMaster.Cid + "' or CreateCompanyId='" + CurrentMaster.Cid + "')";
         }
         if (!string.IsNullOrEmpty(Request["BrandName"]))
         {
             _where += " and (Name like '%" + Request["BrandName"].ToString() + "%')";
         }
         _mySet = bll.GetTreeList(_where);
         List <JsonCompanyTree> list = new FunTreeCommon().GetCompanyTreeNodes(_mySet);
         if (_mySet.Tables[0].Rows.Count > 0 && list.Count == 0)
         {
             for (int i = 0; i < _mySet.Tables[0].Rows.Count; i++)
             {
                 JsonCompanyTree model = new JsonCompanyTree();
                 model.id       = _mySet.Tables[0].Rows[i]["Id"].ToString();
                 model.parentId = "0";
                 model.text     = _mySet.Tables[0].Rows[i]["Name"].ToString();
                 model.expanded = false;
                 model.leaf     = true;
                 model.leaf     = true;
                 list.Add(model);
             }
         }
         Output = JsonHelper.ToJson(list);
     }
     catch
     {
         Output = "";
     }
     WriteJsonToPage(Output);
 }