2026-03-09 00:13:46 +08:00
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_dvideo : Mtxfw . Utility . MemberBase
{
public 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 ;
gtype = new DAL . host ( ) . GetId ( hostname ) ;
if ( ! IsPostBack )
{
if ( Session [ "IFPassword" ] = = null )
{
Response . Redirect ( "/Member_IFPassword.aspx?Url=/Admin_Member_dvideo.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 ( )
{
System . Text . StringBuilder sb = new System . Text . StringBuilder ( ) ;
String morn = HttpUtility . UrlDecode ( Request . QueryString [ "morn" ] ) ;
String state = HttpUtility . UrlDecode ( Request . QueryString [ "state" ] ) ;
String key = HttpUtility . UrlDecode ( Request . QueryString [ "key" ] ) ;
if ( ! String . IsNullOrEmpty ( state ) & & state ! = "" )
{
if ( state = = "0" )
{
sb . Append ( " and Seef=0" ) ;
}
else if ( state = = "1" )
{
sb . Append ( " and Seef=1" ) ;
}
else if ( state = = "2" )
{
sb . Append ( " and IFTJ=1" ) ;
}
else if ( state = = "3" )
{
sb . Append ( " and IFTop=1" ) ;
}
Drop_state . Text = state ;
}
if ( ! String . IsNullOrEmpty ( key ) )
{
key = key . Trim ( ) ;
string fiold = string . Empty ;
if ( morn = = "0" )
{
fiold = "UserName" ;
sb . Append ( " and senderidin(select id from user_info b where b." + fiold + " like '%" + key + "%')" ) ;
}
else if ( morn = = "1" )
{
fiold = "Title" ;
sb . Append ( " and " + fiold + " like '%" + key + "%'" ) ;
}
}
MyPager . PageSize = 50 ;
MyPager . RecordCount = daoArt . GetCount ( "gtype=0 and ParentID=10" + sb . ToString ( ) ) ;
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 UserName,(Select realname From user_info b Where b.Id=a.senderid) as realname," , "gtype=0 and ParentID=10" + sb . ToString ( ) + " Order by Seef asc,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 )
{
try
{
if ( model . senderid = = 0 )
{
Qiniu . Util . Mac mac = new Qiniu . Util . Mac ( config . qiniuAccessKey , config . qiniuSecretKey ) ;
Qiniu . Storage . Config sconfig = new Qiniu . Storage . Config ( ) ;
sconfig . Zone = Qiniu . Storage . Zone . ZONE_CN_South ;
// 空间名
string Bucket = config . qiniuScope ;
Qiniu . Http . HttpResult deleteRet ;
if ( model . Paths ! = "" )
{
string Key = model . Paths ;
deleteRet = new Qiniu . Storage . BucketManager ( mac , sconfig ) . Delete ( Bucket , Key ) ;
}
if ( model . Author ! = "" )
{
string Key = model . Author ;
deleteRet = new Qiniu . Storage . BucketManager ( mac , sconfig ) . Delete ( Bucket , Key ) ;
}
}
}
catch
{
}
Model . User_CZ_log logmodel = new Model . User_CZ_log ( ) ;
logmodel . MemberId = Card ;
logmodel . AddTime = DateTime . Now ;
logmodel . IP = Mtxfw . Utility . Common . GetIP ;
2026-03-13 00:35:44 +08:00
logmodel . Body = "删除任E森命广告视频, 标题: " + model . Title + "" ;
2026-03-09 00:13:46 +08:00
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 )
{
try
{
if ( model . senderid = = 0 )
{
Qiniu . Util . Mac mac = new Qiniu . Util . Mac ( config . qiniuAccessKey , config . qiniuSecretKey ) ;
Qiniu . Storage . Config sconfig = new Qiniu . Storage . Config ( ) ;
sconfig . Zone = Qiniu . Storage . Zone . ZONE_CN_South ;
// 空间名
string Bucket = config . qiniuScope ;
Qiniu . Http . HttpResult deleteRet ;
if ( model . Paths ! = "" )
{
string Key = model . Paths ;
deleteRet = new Qiniu . Storage . BucketManager ( mac , sconfig ) . Delete ( Bucket , Key ) ;
}
if ( model . Author ! = "" )
{
string Key = model . Author ;
deleteRet = new Qiniu . Storage . BucketManager ( mac , sconfig ) . Delete ( Bucket , Key ) ;
}
}
}
catch
{
}
Model . User_CZ_log logmodel = new Model . User_CZ_log ( ) ;
logmodel . MemberId = Card ;
logmodel . AddTime = DateTime . Now ;
logmodel . IP = Mtxfw . Utility . Common . GetIP ;
2026-03-13 00:35:44 +08:00
logmodel . Body = "删除任E森命广告视频, 标题: " + model . Title + "" ;
2026-03-09 00:13:46 +08:00
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 ;
2026-03-13 00:35:44 +08:00
logmodel . Body = "审核通过任E森命广告视频, 标题: " + model . Title + "" ;
2026-03-09 00:13:46 +08:00
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 ;
2026-03-13 00:35:44 +08:00
logmodel . Body = "取消审核任E森命广告视频, 标题: " + model . Title + "" ;
2026-03-09 00:13:46 +08:00
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 ) ;
}
}
}
else if ( strs = = "4" )
{
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 ;
2026-03-13 00:35:44 +08:00
logmodel . Body = "任E森命设为推荐广告视频, 标题: " + model . Title + "" ;
2026-03-09 00:13:46 +08:00
logmodel . UType = 0 ;
logmodel . gtype = gtype ;
new DAL . User_CZ_log ( ) . Add ( logmodel ) ;
daoArt . UpdateuSel ( "IFTJ" , 1 , strID ) ;
}
}
else if ( strs = = "5" )
{
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 ;
2026-03-13 00:35:44 +08:00
logmodel . Body = "任E森命取消推荐广告视频, 标题: " + model . Title + "" ;
2026-03-09 00:13:46 +08:00
logmodel . UType = 0 ;
logmodel . gtype = gtype ;
new DAL . User_CZ_log ( ) . Add ( logmodel ) ;
daoArt . UpdateuSel ( "IFTJ" , 0 , strID ) ;
}
}
else if ( strs = = "6" )
{
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 ;
2026-03-13 00:35:44 +08:00
logmodel . Body = "任E森命设为置顶广告视频, 标题: " + model . Title + "" ;
2026-03-09 00:13:46 +08:00
logmodel . UType = 0 ;
logmodel . gtype = gtype ;
new DAL . User_CZ_log ( ) . Add ( logmodel ) ;
daoArt . UpdateuSel ( "IFTop" , 1 , strID ) ;
}
}
else if ( strs = = "7" )
{
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 ;
2026-03-13 00:35:44 +08:00
logmodel . Body = "任E森命取消置顶广告视频, 标题: " + model . Title + "" ;
2026-03-09 00:13:46 +08:00
logmodel . UType = 0 ;
logmodel . gtype = gtype ;
new DAL . User_CZ_log ( ) . Add ( logmodel ) ;
daoArt . UpdateuSel ( "IFTop" , 0 , strID ) ;
}
}
}
}
Data_Bind ( ) ;
}
}
}