Files
g.hnyhua.cn/Mtxfw.VipSite/Admin_Member_gong1.aspx.cs
2026-02-07 15:48:27 +08:00

177 lines
7.3 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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_gong1 : Mtxfw.Utility.MemberBase
{
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_gong1.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=19");
if (MyPager.RecordCount == 0)
{
MyPager.Visible = false;
}
Mtxfw.Utility.Tools.ToBind(Repeater1, daoArt.GetPager(MyPager, "(select b.LBName from user_Goods_lb b where b.id=Convert(int,a.CategoryId)) as LBName,", "gtype=" + gtype + " and ParentID=19 Order by LinkID desc"));
}
protected void Delete_Click(object s, CommandEventArgs ex)
{
Int32 ID = int.Parse(ex.CommandName);
Mtxfw.Model.Article model = daoArt.GetModel(ID);
if (model != null)
{
if (model.Paths != "")
{
try
{
string yvideo = model.Paths;
File.Delete(Server.MapPath(yvideo));
model.Paths = "";
}
catch
{
}
}
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.Title + "";
logmodel.UType = 0;
logmodel.gtype = gtype;
new DAL.User_CZ_log().Add(logmodel);
}
daoArt.Delete(ID);
Response.Redirect(Request.Url.AbsoluteUri);
}
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.Paths != "")
{
try
{
string yvideo = model.Paths;
File.Delete(Server.MapPath(yvideo));
model.Paths = "";
}
catch
{
}
}
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.Title + "";
logmodel.UType = 0;
logmodel.gtype = gtype;
new DAL.User_CZ_log().Add(logmodel);
daoArt.Delete(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.Title + "";
logmodel.UType = 0;
logmodel.gtype = gtype;
new DAL.User_CZ_log().Add(logmodel);
//daoArt.UpdateuSeef();
daoArt.UpdateuSel("Seef", 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.Title + "";
logmodel.UType = 0;
logmodel.gtype = gtype;
new DAL.User_CZ_log().Add(logmodel);
daoArt.UpdateuSel("Seef", 0, strID);
}
}
else if (strs == "3")
{
Mtxfw.Model.Article model = daoArt.GetModel(strID);
if (model != null)
{
TextBox LinkID = (TextBox)Item.FindControl("txtLinkID");
if (!System.Text.RegularExpressions.Regex.IsMatch(LinkID.Text, @"^-?\d+$"))
{
ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('" + model.Title + "的排序ID填写错误');</script>");
}
else
{
daoArt.UpdateuSel("LinkID", Convert.ToInt32(LinkID.Text), strID);
}
}
}
}
}
Data_Bind();
}
}
}