private void InitPage() { BLL.SendMsg send2 = new BLL.SendMsg(); send2.ToUsercode = user.UserCode; send2.State = "1"; send2.todel = "0"; if (send2.GetSendMsgs().Rows.Count > 0) { string code = send2.GetSendMsgs().Rows[0]["SendMsgCode"].ToString(); Response.Redirect("sendmsgview.aspx?MsgCode=" + code + "&Re=true"); } else { BLL.SendMsg send = new BLL.SendMsg(); send.SendUsercode = user.UserCode; send.senddel = "0"; dgList.DataSource = send.GetSendMsgs(); dgList.DataBind(); this.GridPagination1.RowsCount = send.GetSendMsgs().Rows.Count.ToString(); BLL.SendMsg send1 = new BLL.SendMsg(); send1.ToUsercode = user.UserCode; send1.todel = "0"; Datagrid1.DataSource = send1.GetSendMsgs(); Datagrid1.DataBind(); this.GridPagination2.RowsCount = send1.GetSendMsgs().Rows.Count.ToString(); } }
protected void Page_Load(object sender, System.EventArgs e) { if (Request["Flag"] == null) { string MsgScript = ""; string InLineUser = "******"#\" onclick=\"javascript:goInLinePage();return false;\">在线人数:" + ((Hashtable)Application["UserTable"]).Count.ToString() + "</a>"; BLL.SendMsg msg = new BLL.SendMsg(); msg.ToUsercode = ((User)Session["User"]).UserCode; msg.State = "1"; msg.todel = "0"; if (msg.GetSendMsgs().Rows.Count > 0) { MsgScript = "<a href=\"#\" onclick=\"javascript:goMsgManage();return false;\"><IMG runat=\"server\" id=\"MsgImg\" border=\"0\" alt=\"消息\" src=\"Images/ShowMsg.gif\"></a>"; } else { MsgScript = "<a href=\"#\" onclick=\"javascript:goMsgManage();return false;\"><IMG runat=\"server\" id=\"MsgImg\" border=\"0\" alt=\"消息\" src=\"Images/Msg.gif\"></a>"; } this.scriptspan.InnerHtml = "<script language=\"javascript\">" + "window.parent.tdInLineUser.innerHTML = '" + InLineUser + "';" + "window.parent.TdMsgImg.innerHTML = '" + MsgScript + "';" + "</script>"; } else { /********************** 在线用户统计 ***************************/ Session.Abandon(); /***************************************************************/ } }