Exemple #1
0
    /// <summary>
    /// 查询具体的信息
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public void GetView()
    {
        var id   = PageRequest.GetInt("FlagId", 0);
        var dt   = new Sys.BLL.EquipmentModel().GetEqpModelInfo("e1.ModelId=" + id);
        var data = MyDBUtils.DataTable2ArrayList(dt);
        var user = data.Count > 0 ? (Hashtable)data[0] : null;
        var json = PluSoft.Utils.JSON.Encode(user);

        Response.Write(json);
        Response.End();
    }
Exemple #2
0
    /// <summary>
    /// 删除
    /// </summary>
    public void DelFlag()
    {
        var flagId = PageRequest.GetInt("FlagId", 0);

        if (flagId > 0)
        {
            var dt = new Sys.BLL.EquipmentModel().GetList("ParentModelId=" + flagId).Tables[0];
            if (dt != null && dt.Rows.Count > 0)
            {
                Response.Write("0");
            }
            else
            {
                var result = new Sys.BLL.EquipmentModel().Delete(flagId);
                if (result)
                {
                    Response.Write("1");
                }
            }
        }
    }
Exemple #3
0
    /// <summary>
    /// 查询
    /// </summary>
    public void SearchData()
    {
        //查询条件
        var key = Utils.SqlStringFormat(PageRequest.GetString("key"), 2);
        //分页
        var pageIndex = PageRequest.GetInt("pageIndex", 1);
        var pageSize  = PageRequest.GetInt("pageSize", 1);
        //字段排序
        var sortField = PageRequest.GetString("sortField");
        var sortOrder = PageRequest.GetString("sortOrder");
        var order     = "";

        if (String.IsNullOrEmpty(sortField) == false)
        {
            if (sortOrder != "desc")
            {
                sortOrder = "asc";
            }
            order = " " + sortField + " " + sortOrder;
        }
        else
        {
            order += " ModelId desc";
        }

        var strWhere = "";

        if (pageSize == 1)
        {
            pageSize = 10000;
        }
        var dt   = new Sys.BLL.EquipmentModel().GetList(pageSize, pageIndex, strWhere, order);
        var json = Midea.Common.JsonHelper.ObjectToJson(dt);

        Response.Write(json);
        Response.End();
    }