zoukankan      html  css  js  c++  java
  • 加载数据库User表中创建人,显示到界面控件中,其中数据库定义是int 型 外键(User表)

    if (BaseClass.UserCache.ContainsKey(userInfo.CreatedBy ?? -1))

                        {

     

                            txtCreateBy.Text = BaseClass.UserCache[userInfo.CreatedBy ?? -1];

                        }

                        else txtCreateBy.Text = "error";

    PublicBase.cs类

            /// <summary>

            /// 用户名缓存:key=UserId value=DisPlayName

            /// </summary>

            public static Dictionary<int, string> UserCache = new Dictionary<int, string>();

    UserMessage类:public int? CreatedBy { get; set; }

  • 相关阅读:
    touch
    ls
    Linux基础
    errors
    strconv
    strings
    fmt
    os/exec
    笔记本连不上网怎么办
    笔记本连不上网怎么办
  • 原文地址:https://www.cnblogs.com/lqsilly/p/2819593.html
Copyright © 2011-2022 走看看