/// <summary>
    /// 获取设备(未授权)
    /// </summary>
    /// <param name="strparam"></param>
    /// <param name="pageIndex"></param>
    /// <param name="pageSize"></param>
    /// <param name="sort"></param>
    /// <returns></returns>
    public string GetNotGrantEquipment(string strparam, int pageIndex, int pageSize, string sort)
    {
        Dictionary <string, string> dic = MyJson.JsonToDictionary(strparam);
        ReturnValue retVal = equLogic.GetNotGrantEquipment(new EquipmentInfo()
        {
            EIName = dic.ContainsKey("einame") ? dic["einame"] : string.Empty,
            EIID   = dic.ContainsKey("eiid") ? Tools.GetInt32(dic["eiid"], -1) : -1
        });

        if (retVal.IsSuccess == false)
        {
            return(MyXml.CreateTabledResultXml(new DataTable(), 0, 10, 0).InnerXml);
        }
        //
        DataTable dt = Tools.GetDt4Drs(retVal.RetDt, Tools.GetStartRec(pageSize, pageIndex), Tools.GetEndRec(pageSize, pageIndex)) ?? new DataTable();

        return(MyXml.CreateTabledResultXml(dt, pageIndex, pageSize, dt.Rows.Count).InnerXml);
    }
    /// <summary>
    ///
    /// </summary>
    /// <returns></returns>
    protected override XmlDocument CreateInitInfo()
    {
        //删除过期设备
        //ReturnValue retVal = uegLogic.DeleteExpire(new UserEquipmentGrantInfo() { EndDate = DateTime.Now });
        //if (retVal.IsSuccess == false) { return MyXml.CreateResultXml(-1, "删除过期授权设备时异常", string.Empty); }

        XmlDocument xmlDoc   = MyXml.CreateResultXml(1, string.Empty, string.Empty);
        XmlNode     rootNode = xmlDoc.SelectSingleNode("xml");

        XmlNode userNode               = MyXml.AddXmlNode(rootNode, "users");
        XmlNode equipmentsNode         = MyXml.AddXmlNode(rootNode, "equipments");
        XmlNode grantequipmentsNode    = MyXml.AddXmlNode(rootNode, "grantequipments");
        XmlNode notgrantequipmentsNode = MyXml.AddXmlNode(rootNode, "notgrantequipments");
        //用户对象
        ReturnValue retVal = userLogic.GetUser(new UserInfo()
        {
            UserID = -1
        });

        if (retVal.IsSuccess == false)
        {
            return(MyXml.CreateResultXml(-1, "加载用户时异常", string.Empty));
        }
        {//排序
            DataView dv = retVal.RetDt.DefaultView;
            dv.Sort      = "username";
            retVal.RetDt = dv.ToTable();
        }
        foreach (DataRow dr in retVal.RetDt.Rows)
        {
            XmlNode itemNode = MyXml.AddXmlNode(userNode, "item");
            MyXml.AddAttribute(itemNode, "key", dr["userid"]);
            MyXml.AddAttribute(itemNode, "name", string.Format("{0}【{1}】", dr["username"], dr["usernick"]));
        }

        //设备对象
        retVal = equLogic.GetEquipment(new EquipmentInfo()
        {
            EIID = -1
        });
        if (retVal.IsSuccess == false)
        {
            return(MyXml.CreateResultXml(-1, "加载设备时异常", string.Empty));
        }
        {//排序
            DataView dv = retVal.RetDt.DefaultView;
            dv.Sort      = "einame";
            retVal.RetDt = dv.ToTable();
        }
        foreach (DataRow dr in retVal.RetDt.Rows)
        {
            XmlNode itemNode = MyXml.AddXmlNode(equipmentsNode, "item");
            MyXml.AddAttribute(itemNode, "key", dr["eiid"]);
            MyXml.AddAttribute(itemNode, "name", dr["einame"]);
        }

        //未授权设备对象
        retVal = equLogic.GetNotGrantEquipment(new EquipmentInfo()
        {
            EIID = -1
        });
        if (retVal.IsSuccess == false)
        {
            return(MyXml.CreateResultXml(-1, "加载未授权设备时异常", string.Empty));
        }
        {//排序
            DataView dv = retVal.RetDt.DefaultView;
            dv.Sort      = "einame";
            retVal.RetDt = dv.ToTable();
        }
        foreach (DataRow dr in retVal.RetDt.Rows)
        {
            XmlNode itemNode = MyXml.AddXmlNode(notgrantequipmentsNode, "item");
            MyXml.AddAttribute(itemNode, "key", dr["eiid"]);
            MyXml.AddAttribute(itemNode, "name", dr["einame"]);
        }

        //昂前登录用户授权设备对象
        retVal = uegLogic.GetUserEquGrant(new UserEquipmentGrantInfo()
        {
            UserID = Tools.GetInt32(IPApi.UserID, int.MaxValue)
        });
        if (retVal.IsSuccess == false)
        {
            return(MyXml.CreateResultXml(-1, "加载未授权设备时异常", string.Empty));
        }
        {//排序
            DataView dv = retVal.RetDt.DefaultView;
            dv.Sort      = "einame";
            retVal.RetDt = dv.ToTable();
        }
        foreach (DataRow dr in retVal.RetDt.Rows)
        {
            XmlNode itemNode = MyXml.AddXmlNode(grantequipmentsNode, "item");
            MyXml.AddAttribute(itemNode, "key", dr["eiid"]);
            MyXml.AddAttribute(itemNode, "name", dr["einame"]);
        }

        return(xmlDoc);
    }