zoukankan      html  css  js  c++  java
  • 取 照片

    public void pictureShow()
           {
               try
               {
                   int i = 0;
                   string sql1 = "select  UserName,RealName,Photo,Memo from TeacherUser where UserName in (select top 6 UserName from TeacherUser order by NewId()) order by UserName ASC";//头像,用户名查询语句  排序需求 双重嵌套  NEWID 是排序 不能和 ASC 一起
                   DataTable dt1 = DBUtility.DbHelperSQL.Query(sql1).Tables[0];

                   string sqlParameter = string.Empty;
                   for (int r = 0; r < dt1.Rows.Count;r++ ) {
                       sqlParameter=sqlParameter+"'"+dt1.Rows[r][0]+"'"+",";
                   }
                   sqlParameter = sqlParameter.Substring(0, sqlParameter.Length - 1);

                   string sql2 = "select distinct UserName,SubjectId from R_TeacherSubject where UserName in (" + sqlParameter + ")";//科目信息查询语句
                   DataTable dt2 = DBUtility.DbHelperSQL.Query(sql2).Tables[0];

                   string sql3 = "select Id,Caption from D_Subject";
                   DataTable dt3 = DBUtility.DbHelperSQL.Query(sql3).Tables[0];
                   picture.InnerHtml = "";
                   string[] SubCollect = new string[6];
                   for (i = 0; i < 6; i++)
                   {

                       SubCollect[i] = "";
                       string[] Split = dt2.Rows[i]["SubjectId"].ToString().Split(new char[] { ',' });

                       for (int k = 0; k < dt3.Rows.Count; k++)
                       {
                           for (int j = 0; j <Split.Length; j++)
                           {
                               if (j == 2) { break; }
                               if (dt3.Rows[k]["Id"].ToString().Equals(Split[j]))
                               {
                                   SubCollect[i] = SubCollect[i] + dt3.Rows[k]["Caption"].ToString() + ",";
                               }
                           }

                       }
                       Split = null;
                       SubCollect[i] = SubCollect[i].ToString().Substring(0, SubCollect[i].ToString().Length - 1);
                       picture.InnerHtml +=
                           " <li style='margin-left: 10px;'><a href='DefaultTwo.aspx?operationType=6' style='margin-right: 50px;'><img src='" + dt1.Rows[i]["Photo"].ToString() + "' /></a><p><a href='DefaultTwo.aspx?operationType=6'>" + dt1.Rows[i]["RealName"].ToString() + "</a></p><p>主 讲:<span>" + SubCollect[i] + "</span></p></li>";
                   }
                   SubCollect = null;
               }
               catch
               {
               }

  • 相关阅读:
    开源blog搬家工具
    嵌入式语言Lua
    ChangeMan Version Manager Workstation 8.1 command line quick check in/out
    Mssql合并列值(三个关系表合并)
    心得——学习中做笔记应该做到哪
    MFC Dialog 透明渐变
    【转】SSDT&Shadow Hook的实现,完整代码。可编译
    ssdt 表结构及hook的一般理解
    <转>ssdt hook 源码
    【转】_declspec(naked) 使用
  • 原文地址:https://www.cnblogs.com/mahaisong/p/1971135.html
Copyright © 2011-2022 走看看