ad88/sys/SyRoleMenu.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
//using CSA;

public partial class sys_SyRoleMenu : AdminPage
{
    string TblName = "Sy_Role";

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                string id = Request["id"];  //Role id
                this.PKID.Value = id;
                lblRoleName.InnerHtml = Convert.ToString(getColumnItemByPKID(TblName, id, "Code,Name"));
            }
        }
        catch { }
    }
    /// <summary>
    /// 取表的列数据,可按PKID, if pkid is null then get top one in datasource
    /// </summary>
    /// <param name="tblName"></param>
    /// <param name="pkid"></param>
    /// <param name="colName"></param>
    /// <returns></returns>
    public static object getColumnItemByPKID(string tblName, object pkid, string colNames)
    {
        try
        {
            if (string.IsNullOrEmpty(colNames)) return "";

            string[] _cols = colNames.Split(',');
            if (_cols.Length > 1)
            {
                colNames = "";
                foreach (string _s in _cols)
                {
                    colNames += string.Format("+','+ISNULL({0},'')", _s);
                }
                if (colNames.Length > 0) colNames = colNames.Substring(5);
            }

            if (object.Equals(null, pkid) || "".Equals(pkid))
            {
                colNames = " TOP 1 " + colNames;
            }
            else
            {
                pkid = " WHERE PKID='" + pkid.ToString() + "'";
后面还有 10 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。