181 lines
7.6 KiB
C#
181 lines
7.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.IO;
|
|
namespace Mtxfw.VipSite
|
|
{
|
|
public partial class Admin_Member_chat : Mtxfw.Utility.MemberBase
|
|
{
|
|
public Mtxfw.Utility.emojiconsConfig econfig = new Mtxfw.Utility.emojiconsConfig();
|
|
public Mtxfw.DAL.Article daoArt = new Mtxfw.DAL.Article();
|
|
DAL.user_info daoUser = new DAL.user_info();
|
|
public string strTitle = "客服信息管理";
|
|
public int t = 0;
|
|
public int gtype = 0;
|
|
protected override void OnLoad(EventArgs e)
|
|
{
|
|
base.OnLoad(e);
|
|
string hostname = Request.Url.Host;
|
|
|
|
if (!String.IsNullOrEmpty(Request.QueryString["t"]))
|
|
{
|
|
t = Convert.ToInt32(Request.QueryString["t"].ToString());
|
|
}
|
|
if (t == 1)
|
|
{
|
|
strTitle = "私聊信息管理";
|
|
}
|
|
if (t == 2)
|
|
{
|
|
strTitle = "群聊信息管理";
|
|
}
|
|
if (!IsPostBack)
|
|
{
|
|
if (Session["IFPassword"] == null)
|
|
{
|
|
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_chat.aspx" + HttpUtility.UrlEncode("?t=" + t));
|
|
}
|
|
if (IFStores != 1)
|
|
{
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|
}
|
|
if (MemberJS.IndexOf(strTitle) == -1)
|
|
{
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|
}
|
|
Data_Bind();
|
|
Page.Title = strTitle + " - " + GetWebName;
|
|
if (t == 33)
|
|
{
|
|
seclect_Drop.Items.Add(new ListItem("审核", "2"));
|
|
}
|
|
}
|
|
|
|
MyPager.PageChanged += delegate(object s, EventArgs ex)
|
|
{
|
|
Data_Bind();
|
|
};
|
|
}
|
|
|
|
protected void Data_Bind()
|
|
{
|
|
MyPager.PageSize = 50;
|
|
MyPager.RecordCount = daoArt.GetCount("gtype=" + gtype + " and ParentID=21 and wtype=" + t + " and senderid>0");
|
|
if (MyPager.RecordCount == 0)
|
|
{
|
|
MyPager.Visible = false;
|
|
}
|
|
Mtxfw.Utility.Tools.ToBind(Repeater1, daoArt.GetPager(MyPager, "(Select UserName From user_info b Where b.id=a.senderid) as senderName,(Select realname From user_info b Where b.id=a.senderid) as realname,(Select UserName From user_info b Where b.id=a.receiverid) as receiverName,(Select realname From user_info b Where b.id=a.receiverid) as realname2,", "gtype=" + gtype + " and ParentID=21 and wtype=" + t + " and senderid>0 Order by AddTime desc"));
|
|
}
|
|
protected void JY_Click(object s, CommandEventArgs ex)
|
|
{
|
|
Int32 ID = int.Parse(ex.CommandName);
|
|
if (ID > 0)
|
|
{
|
|
Mtxfw.Model.user_info model = daoUser.GetModel(ID);
|
|
if (model != null)
|
|
{
|
|
Model.User_CZ_log logmodel = new Model.User_CZ_log();
|
|
logmodel.MemberId = Card;
|
|
logmodel.AddTime = DateTime.Now;
|
|
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
|
logmodel.Body = "禁言,会员:" + model.UserName + "";
|
|
logmodel.UType = 0;
|
|
logmodel.gtype = gtype;
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|
}
|
|
}
|
|
Data_Bind();
|
|
}
|
|
protected void Run_Click(object s, System.EventArgs e)
|
|
{
|
|
|
|
CheckBox Check = new CheckBox();
|
|
string strs = seclect_Drop.SelectedItem.Value;
|
|
foreach (RepeaterItem Item in Repeater1.Items)
|
|
{
|
|
//在行中查找到该单选框
|
|
Check = (CheckBox)Item.FindControl("checka");
|
|
int strID = int.Parse(Check.CssClass);
|
|
if (Check.Checked == true)
|
|
{
|
|
if (strs == "0")
|
|
{
|
|
Mtxfw.Model.Article model = daoArt.GetModel(strID);
|
|
if (model != null)
|
|
{
|
|
if (model.CategoryId != "0")
|
|
{
|
|
try
|
|
{
|
|
File.Delete(Server.MapPath(model.Content));
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
}
|
|
daoArt.Delete(strID);
|
|
daoArt.Delete("gtype=" + model.gtype + " and ParentID=" + model.ParentID + " And wtype=" + model.wtype + " And receiverid=" + model.senderid + "");
|
|
}
|
|
}
|
|
else if (strs == "1")
|
|
{
|
|
Mtxfw.Model.Article model = daoArt.GetModel(strID);
|
|
if (model != null)
|
|
{
|
|
string strUserName = daoUser.Getzd("UserName", "id=" + model.senderid).ToString();
|
|
if (strUserName != "")
|
|
{
|
|
|
|
Model.User_CZ_log logmodel = new Model.User_CZ_log();
|
|
logmodel.MemberId = Card;
|
|
logmodel.AddTime = DateTime.Now;
|
|
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
|
logmodel.Body = "禁言,会员:" + strUserName + "";
|
|
logmodel.UType = 0;
|
|
logmodel.gtype = gtype;
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|
}
|
|
}
|
|
}
|
|
else if (strs == "2")
|
|
{
|
|
Mtxfw.Model.Article model = daoArt.GetModel(strID);
|
|
if (model != null)
|
|
{
|
|
string strUserName = daoUser.Getzd("UserName", "id=" + model.senderid).ToString();
|
|
if (strUserName != "")
|
|
{
|
|
daoArt.UpdateuSel("Seef", 1, strID);
|
|
Model.User_CZ_log logmodel = new Model.User_CZ_log();
|
|
logmodel.MemberId = Card;
|
|
logmodel.AddTime = DateTime.Now;
|
|
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
|
logmodel.Body = "审核聊天信息,内容:" + Mtxfw.Utility.Common.CnCutString2(model.Content, 100, "...") + "";
|
|
logmodel.UType = 0;
|
|
logmodel.gtype = gtype;
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (strs == "0")
|
|
{
|
|
|
|
Model.User_CZ_log logmodel = new Model.User_CZ_log();
|
|
logmodel.MemberId = Card;
|
|
logmodel.AddTime = DateTime.Now;
|
|
logmodel.IP = Mtxfw.Utility.Common.GetIP;
|
|
logmodel.Body = "删除聊天信息";
|
|
logmodel.UType = 0;
|
|
logmodel.gtype = gtype;
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|
}
|
|
Data_Bind();
|
|
}
|
|
|
|
}
|
|
} |