128 lines
4.3 KiB
C#
128 lines
4.3 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Web;
|
|||
|
|
using System.Web.UI;
|
|||
|
|
using System.Web.UI.WebControls;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Data;
|
|||
|
|
namespace Mtxfw.VipSite
|
|||
|
|
{
|
|||
|
|
public partial class Admin_Member_Products_PinLun : Mtxfw.Utility.MemberBase
|
|||
|
|
{
|
|||
|
|
public Mtxfw.DAL.Guest daoGuest = new Mtxfw.DAL.Guest();
|
|||
|
|
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
|
|||
|
|
public int gtype = 0;
|
|||
|
|
#region 判断页面是否刷新
|
|||
|
|
private bool _refreshState;
|
|||
|
|
private bool _isRefresh;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 判断页面是否刷新
|
|||
|
|
/// </summary>
|
|||
|
|
public bool IsRefresh
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _isRefresh;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
protected override void LoadViewState(object savedState)
|
|||
|
|
{
|
|||
|
|
object[] allStates = (object[])savedState;
|
|||
|
|
base.LoadViewState(allStates[0]);
|
|||
|
|
_refreshState = (bool)allStates[1];
|
|||
|
|
_isRefresh = _refreshState == (bool)Session["__ISREFRESH"];
|
|||
|
|
}
|
|||
|
|
protected override object SaveViewState()
|
|||
|
|
{
|
|||
|
|
Session["__ISREFRESH"] = _refreshState;
|
|||
|
|
object[] allStates = new object[2];
|
|||
|
|
allStates[0] = base.SaveViewState();
|
|||
|
|
allStates[1] = !_refreshState;
|
|||
|
|
return allStates;
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
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_Products_PinLun.aspx");
|
|||
|
|
}
|
|||
|
|
if (IFStores != 1)
|
|||
|
|
{
|
|||
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|||
|
|
}
|
|||
|
|
if (MemberJS.IndexOf("商品评论管理") == -1)
|
|||
|
|
{
|
|||
|
|
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
|
|||
|
|
}
|
|||
|
|
Page.Title = "商品评论管理 - " + GetWebName;
|
|||
|
|
|
|||
|
|
Data_Bind();
|
|||
|
|
}
|
|||
|
|
MyPager.PageChanged += delegate(object s, EventArgs ex)
|
|||
|
|
{
|
|||
|
|
Data_Bind();
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
protected void Data_Bind()
|
|||
|
|
{
|
|||
|
|
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
|||
|
|
MyPager.PageSize = 20;
|
|||
|
|
MyPager.RecordCount = daoGuest.GetCount("gtype=" + gtype + " and ttype=0" + sb.ToString());
|
|||
|
|
Mtxfw.Utility.Tools.ToBind(Repeater1, daoGuest.GetPager(MyPager, "(select top 1 P_NAME from P_Product as b where b.P_Id=BusinessID) as bName,", "gtype=" + gtype + " and ttype=0" + sb.ToString() + " Order by IsShow,ID desc"));
|
|||
|
|
|
|||
|
|
foreach (RepeaterItem item in Repeater1.Items)
|
|||
|
|
{
|
|||
|
|
LinkButton lb = item.FindControl("Btn_Check") as LinkButton;
|
|||
|
|
HiddenField hf = item.FindControl("Hidd_IsShow") as HiddenField;
|
|||
|
|
if (hf.Value == "1")
|
|||
|
|
{
|
|||
|
|
lb.Enabled = false;
|
|||
|
|
lb.Text = "已审";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void Delete_Click(object s, CommandEventArgs ex)
|
|||
|
|
{
|
|||
|
|
Int32 ID = int.Parse(ex.CommandName);
|
|||
|
|
daoGuest.Delete(ID);
|
|||
|
|
Response.Redirect(Request.Url.AbsoluteUri);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void Check_Click(object s, CommandEventArgs ex)
|
|||
|
|
{
|
|||
|
|
Int32 ID = int.Parse(ex.CommandName);
|
|||
|
|
daoGuest.UpdataCheck(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")
|
|||
|
|
{
|
|||
|
|
daoGuest.Delete(strID);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
Response.Redirect(Request.Url.AbsoluteUri);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|