137 lines
5.5 KiB
C#
137 lines
5.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace Mtxfw.VipSite
|
|
{
|
|
public partial class Admin_Member_dongtai : Mtxfw.Utility.MemberBase
|
|
{
|
|
private Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
|
|
public Mtxfw.DAL.Article daoArt = new Mtxfw.DAL.Article();
|
|
public int gtype = 0;
|
|
protected override void OnLoad(EventArgs e)
|
|
{
|
|
base.OnLoad(e);
|
|
string hostname = Request.Url.Host;
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
if (Session["IFPassword"] == null)
|
|
{
|
|
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_news.aspx");
|
|
}
|
|
if (IFStores != 1)
|
|
{
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|
}
|
|
if (MemberJS.IndexOf("新闻管理") == -1)
|
|
{
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|
}
|
|
Data_Bind();
|
|
Page.Title = "新闻管理 - " + GetWebName;
|
|
}
|
|
|
|
MyPager.PageChanged += delegate(object s, EventArgs ex)
|
|
{
|
|
Data_Bind();
|
|
};
|
|
}
|
|
|
|
protected void Data_Bind()
|
|
{
|
|
MyPager.PageSize = 50;
|
|
MyPager.RecordCount = daoArt.GetCount("gtype=" + gtype + " and ParentID=22");
|
|
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,", "gtype=" + gtype + " and ParentID=22 Order by AddTime desc"));
|
|
}
|
|
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)
|
|
{
|
|
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.Content + "";
|
|
logmodel.UType = 0;
|
|
logmodel.gtype = gtype;
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|
daoArt.Delete2(strID);
|
|
}
|
|
}
|
|
else if (strs == "1")
|
|
{
|
|
Mtxfw.Model.Article model = daoArt.GetModel(strID);
|
|
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.Content + "";
|
|
logmodel.UType = 0;
|
|
logmodel.gtype = gtype;
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|
daoArt.UpdateuSeef();
|
|
daoArt.UpdateuSel("hasRead", 1, strID);
|
|
}
|
|
}
|
|
else if (strs == "2")
|
|
{
|
|
Mtxfw.Model.Article model = daoArt.GetModel(strID);
|
|
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.Content + "";
|
|
logmodel.UType = 0;
|
|
logmodel.gtype = gtype;
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|
daoArt.UpdateuSel("hasRead", 0, strID);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Data_Bind();
|
|
}
|
|
public string getimgs(string images)
|
|
{
|
|
string content = "";
|
|
if (images != "")
|
|
{
|
|
content += "<p>";
|
|
string[] aimages = images.Split('|');
|
|
foreach (string strimg in aimages)
|
|
{
|
|
if (strimg != "")
|
|
{
|
|
content += "<img src='" + config.webUrl + Mtxfw.Utility.Common.GetCoverPic(strimg, "100x100", "cut") + "' />";
|
|
}
|
|
}
|
|
content += "</p>";
|
|
}
|
|
return content;
|
|
}
|
|
}
|
|
} |