示例#1
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 += " createtime desc";
        }
        var strWhere = "";

        if (key != "")
        {
            strWhere += "charIndex('" + key + "',FlagName) > 0";
        }


        if (pageSize == 1)
        {
            pageSize = 1000;
        }
        var dt      = new Sys.BLL.AdminFlag().GetTable(-1, -1, strWhere, order);
        var dataAll = MyDBUtils.DataTable2ArrayList(dt);
        var result  = new Hashtable();

        result["data"] = dataAll;
        //var total = new Sys.BLL.Common().GetCount("Sys_Flag", strWhere);
        //result["total"] = total;
        //JSON
        var json = PluSoft.Utils.JSON.Encode(dataAll);

        Response.Write(json);

        //var tempstring = "[{\"FlagId\": \"1\",\"FlagName\": \"项目范围规划\",\"Duration\": 8,\"Start\": \"2007-01-01T00:00:00\",\"Finish\": \"2007-01-10T00:00:00\",\"PercentComplete\": 0,\"Summary\": 1,\"Critical\": 0,\"Milestone\": 0,\"PredecessorLink\": [],\"ParentId\": -1},{\"FlagId\": \"2\",\"FlagName\": \"确定项目范围\",\"Duration\": 1,\"Start\": \"2007-01-01T00:00:00\",\"Finish\": \"2007-01-01T23:23:59\",\"PercentComplete\": 30,\"Summary\": 0,\"Critical\": 0,\"Milestone\": 0,\"PredecessorLink\": [],\"ParentId\": \"1\"}]";
        //Response.Write(tempstring);
    }
示例#2
0
    /// <summary>
    /// 检测管理员是否有当前模块权限
    /// </summary>
    /// <param name="Flag"></param>
    /// <returns></returns>
    public static bool CheckAdminHavePower1(string FlagAct)
    {
        bool flag = false;
        //admin
        int userID = Sys.BLL.Account.GetLoginAdminID();

        Sys.BLL.Admin   bllAdmin   = new Sys.BLL.Admin();
        Sys.Model.Admin modelAdmin = bllAdmin.GetModel(userID);
        //adminFlag
        Sys.BLL.AdminFlag          bllFlag = new Sys.BLL.AdminFlag();
        List <Sys.Model.AdminFlag> list    = bllFlag.GetList(0, -1, -1, FlagAct);

        foreach (Sys.Model.AdminFlag model in list)
        {
            modelAdmin.UserFlag = "," + modelAdmin.UserFlag + ",";
            if (modelAdmin.UserFlag.IndexOf("," + model.Flag + ",") != -1)
            {
                flag = true;
            }
        }
        return(flag);
    }