Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //codingChatHub cc = new codingChatHub();
            Dictionary <string, string> data = new Dictionary <string, string>();

            data = codingChatHub.UserHandler.SeverIds;
            AuthorityClient.UserInfoClient client = new AuthorityClient.UserInfoClient();
            DataTable dt     = client.GetOnLineWf();
            string    result = "";

            foreach (DataRow row in dt.Rows)
            {
                result += "<a href='consult.aspx?sid=" + row["userid"].ToString() + "&code=" + row["userid"].ToString() + "&name=" + row["NAME"].ToString() + "' target='_blank'  style='color:red;'>在线" + row["NAME"].ToString() + "</a>";
            }


            //foreach (string str in UserList.getUserId())
            //{
            //   if(data.ContainsKey(str))
            //    {

            //        result += "<a href='consult.aspx?sid=" + data[str].ToString() + "&code=" + str + "' target='_blank'  style='color:red;'>在线" + str + "</a>";
            //    }
            //    else {
            //        result += "<a href='#' target='_blank' style='color:blue;'>离线" + str + "</a>";
            //    }
            //}


            Response.Write(result);
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                target.Value = Request.QueryString.Get("code");
                // HttpUtility.ParseQueryString(Request.Url.Query, Encoding.GetEncoding("UTF-8"));
                uid.Value = System.Guid.NewGuid().ToString() + "_user";
                List <ParameterInfo> list = new FrameCommonClient.ParameterInfoClient().GetListByParentId("bdcf2650-c738-4b25-852a-79a615456441");
                //userinfo.InnerHtml = HttpUtility.ParseQueryString(Request.Url.Query, Encoding.GetEncoding("UTF-8"))["name"].ToString();
                //uname.Value = Request.QueryString.Get("name");
                string html = "";
                foreach (ParameterInfo item in list)
                {
                    html += " <a style='display: block; line-height: 20px;' onclick='requestData(this);' req='" + item.Value2 + "' href='javascript:void(0);'>" + item.Value + "</a>";
                }



                AuthorityClient.UserInfoClient client = new AuthorityClient.UserInfoClient();
                //client.GetIMUserList();
                commonQues.InnerHtml = html;
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string linkurl    = "consult.aspx?sid={0}&code={0}&name={1}";
                string offlinkurl = "javascript:void(0)";
                string tmpl       = @" <td  align='right'  valign=middle   width='{3}%'>
                                <a href='{0}'>  <img src='image/chatlist_head_0{1}.png' /></a> </td><td   valign=middle   width='{3}%'><a href='{0}'>{2}</a>
                            </td>";
                string grouptmpl  = @"<tr  style='background:#eee;font-weight:bold;'>
                            <td colspan={1}>
                                {0}
                            </td>
 
                        </tr>";

                Dictionary <string, string> data = new Dictionary <string, string>();
                data = codingChatHub.UserHandler.SeverIds;
                AuthorityClient.UserInfoClient client = new AuthorityClient.UserInfoClient();
                List <View_IMUser>             list   = client.GetIMUserList().ToList <View_IMUser>();

                int    oneRowCount = 2;
                string group       = "";
                string result      = "";
                int    groupCount  = 0;
                int    tdWidth     = 100 / (oneRowCount * 2);
                for (int k = 0; k < list.Count; k++)
                {
                    View_IMUser item = list[k];
                    if (group != item.DepartCode)
                    {
                        group      = item.DepartCode;
                        groupCount = 0;
                        if (string.IsNullOrWhiteSpace(item.DepartName))
                        {
                            item.DepartName = "未分组";
                        }
                        else
                        {
                            result += string.Format(grouptmpl, item.DepartName, oneRowCount * 2);
                        }
                    }
                    else
                    {
                        groupCount++;
                    }
                    int currentBL = groupCount % oneRowCount;
                    if (currentBL == 0)
                    {
                        result += "<tr>";
                    }

                    if (item.IsOnLine)
                    {
                        result += string.Format(tmpl, string.Format(linkurl, item.ID, item.Name), 1, item.Name, tdWidth);
                    }
                    else
                    {
                        result += string.Format(tmpl, offlinkurl, 2, item.Name, tdWidth);
                    }
                    if (currentBL == oneRowCount - 1)
                    {
                        result += "</tr>";
                    }
                }


                result             = "<table class='onlinelist' width='100%'>" + result + "</table>";
                userinfo.InnerHtml = result;
            }
        }