125 lines
4.5 KiB
C#
125 lines
4.5 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_goods2 : Mtxfw.Utility.MemberBase
|
|
{
|
|
Mtxfw.DAL.user_bank daoBank = new Mtxfw.DAL.user_bank();
|
|
Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
|
|
Mtxfw.DAL.user_Goods daoGoods = new Mtxfw.DAL.user_Goods();
|
|
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_goods2.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();
|
|
|
|
string strOrder = " Order By addtime desc";
|
|
MyPager.PageSize = 20;
|
|
MyPager.RecordCount = daoGoods.GetCount("gtype=" + gtype + " and utype=1" + sb.ToString());
|
|
Mtxfw.Utility.Tools.ToBind(Repeater1, daoGoods.GetPager(MyPager, "", "gtype=" + gtype + " and utype=1" + sb.ToString() + strOrder));
|
|
}
|
|
protected void Run_Click(object s, System.EventArgs e)
|
|
{
|
|
if (IsRefresh == false)
|
|
{
|
|
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.user_Goods model = daoGoods.GetModel(strID);
|
|
if (model != null)
|
|
{
|
|
daoGoods.Delete(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 = "删除购买产品,产品名称:" + model.GoodsName + "";
|
|
logmodel.UType = 0;
|
|
logmodel.gtype = gtype;
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Data_Bind();
|
|
}
|
|
}
|
|
} |