Exemplo n.º 1
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="strparam"></param>
    /// <returns></returns>
    public string Delete(string strparam)
    {
        Dictionary <string, string> dic = MyJson.JsonToDictionary(strparam);
        EquipmentInfo info = new EquipmentInfo()
        {
            EIID = Tools.GetInt32((dic.ContainsKey("eiid") ? dic["eiid"] : "-1"), -1)
        };
        ReturnValue retVal = equLogic.Delete(info);

        if (retVal.IsSuccess == false)
        {
            return(MyXml.CreateTabledResultXml(new DataTable(), 0, 10, 0).InnerXml);
        }

        return(MyXml.CreateResultXml(retVal.RetCode, retVal.RetMsg, string.Empty).InnerXml);
    }
Exemplo n.º 2
0
    /// <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);
    }
Exemplo n.º 3
0
    public string GetList(string strparam, int pageIndex, int pageSize, string sort)
    {
        Dictionary <string, string> dic = MyJson.JsonToDictionary(strparam);
        ReturnValue retVal = userLogic.GetUser(new UserInfo()
        {
            UserName = dic.ContainsKey("username") ? dic["username"] : string.Empty,
            UserNick = dic.ContainsKey("usernick") ? dic["usernick"] : string.Empty,
            UserType = dic.ContainsKey("usertype") ? Tools.GetInt32(dic["usertype"], -1) : -1,
            UserID   = dic.ContainsKey("userid") ? Tools.GetInt32(dic["userid"], -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(retVal.RetDt, pageIndex, pageSize, retVal.RetDt.Rows.Count).InnerXml);
    }
Exemplo n.º 4
0
    public string GetList(string strparam, int pageIndex, int pageSize, string sort)
    {
        Dictionary <string, string> dic = MyJson.JsonToDictionary(strparam);
        ReturnValue retVal = acLogic.GetActiveCode(new ActivationCodeInfo()
        {
            ACCode    = dic.ContainsKey("accode") ? dic["accode"] : string.Empty,
            StartDate = Tools.GetDateTime(dic.ContainsKey("begintime") ? dic["begintime"] : string.Empty, DateTime.MinValue),
            EndDate   = Tools.GetDateTime(dic.ContainsKey("endtime") ? dic["endtime"] : string.Empty, DateTime.MaxValue),
            ACID      = dic.ContainsKey("acid") ? Tools.GetInt32(dic["acid"], -1) : -1
        }, true);

        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(retVal.RetDt, pageIndex, pageSize, retVal.RetDt.Rows.Count).InnerXml);
    }
    public string GetList(string strparam, int pageIndex, int pageSize, string sort)
    {
        Dictionary <string, string> dic = MyJson.JsonToDictionary(strparam);
        ReturnValue retVal = uegLogic.GetUserEquGrant(new UserEquipmentGrantInfo()
        {
            StartDate = Tools.GetDateTime(dic.ContainsKey("begintime") ? dic["begintime"] : string.Empty, DateTime.MinValue),
            EndDate   = Tools.GetDateTime(dic.ContainsKey("endtime") ? dic["endtime"] : string.Empty, DateTime.MaxValue),
            EIID      = dic.ContainsKey("eiid") ? Tools.GetInt32(dic["eiid"], -1) : -1,
            UserID    = dic.ContainsKey("userid") ? Tools.GetInt32(dic["userid"], -1) : -1,
            UEGID     = dic.ContainsKey("uegid") ? Tools.GetInt32(dic["uegid"], -1) : -1,
            UserName  = dic.ContainsKey("username") ? dic["username"] : string.Empty,
            EIName    = dic.ContainsKey("einame") ? dic["einame"] : string.Empty
        });

        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(retVal.RetDt, pageIndex, pageSize, retVal.RetDt.Rows.Count).InnerXml);
    }