@using ZoomLa.BLL.User @using ZoomLa.BLL.Chat @using ZoomLa.Model.Chat @using ZoomLa.BLL.Helper @functions{ private int UserID { get { return DataConverter.CLng(Context.Request.GetParam("uid")); } } //从临时存储中获取 private string UserFlag { get { return Context.Request.GetParam("UserFlag"); } } /// /// visitor:登录行为,如未登录,默认游客(不弹窗) /// admin:后台管理员,默认同步其绑定用户 /// public string Login { get { string value = DataConverter.CStr(Context.Request.GetParam("Login")).ToLower(); if (string.IsNullOrEmpty(value)) { value = "visitor"; } ViewBag.Login = value; return value; } } //仅用于和好友聊天 //private DataTable UserDT //{ // get // { // if (ViewState["UserDT"] == null) // { // ViewState["UserDT"] = buser.SelAll(); // } // return (DataTable)ViewState["UserDT"]; // } // set { ViewState["UserDT"] = value; } //} //protected void Page_PreRender(object sender, EventArgs e) //{ // UserDT = null; //} } @{ B_ChatMsg chatBll = new B_ChatMsg(); M_OnlineUser user = chatBll.GetLogin(Context); B_User_Friend friendBll = new B_User_Friend(); DataTable friendDT = new DataTable(); M_UserInfo mu = new B_User(Context).GetLogin(); if (!mu.IsNull)//用户如已登录,则加载好友表 { friendDT = friendBll.SelMyFriend(mu.UserID); } } @section head{在线聊天} @section content{
请先选择用户 历史记录
    @foreach (DataRow dr in friendDT.Rows) {
  • @dr["UserName"] (检测中)

  • }
支持Ctrl+Enter快捷键发送信息
@if (user != null) { }
} @section script{ @if (!string.IsNullOrEmpty(Login)) { } else if (user == null) { } @if (user != null) { } @if (!string.IsNullOrEmpty(UserFlag))//通过标识与游客交谈 { M_OnlineUser mu = chatBll.GetModelByUid(Context,UserFlag); } else if (UserID > 0)//与指定用户交谈 { M_UserInfo mu = new B_User().SelReturnModel(UserID); } @if (friendDT.Rows.Count > 0) { } }