103 lines
4.0 KiB
C#
103 lines
4.0 KiB
C#
|
|
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_PFYYFL : Mtxfw.Utility.MemberBase
|
|||
|
|
{
|
|||
|
|
public Mtxfw.DAL.P_Category daoCategory = new Mtxfw.DAL.P_Category();
|
|||
|
|
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_PFYYFL.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 = Convert.ToInt32(daoCategory.Getzd("count(C_ID)","gtype=" + gtype + " and ttype=2").ToString());
|
|||
|
|
if (MyPager.RecordCount == 0)
|
|||
|
|
{
|
|||
|
|
MyPager.Visible = false;
|
|||
|
|
}
|
|||
|
|
Mtxfw.Utility.Tools.ToBind(Repeater1, daoCategory.GetPager(MyPager, "", "gtype=" + gtype + " and ttype=2 Order by C_LinkID asc"));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
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 == "1")
|
|||
|
|
{
|
|||
|
|
Mtxfw.Model.P_Category model = daoCategory.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.C_NAME + "";
|
|||
|
|
logmodel.UType = 0;
|
|||
|
|
logmodel.gtype = gtype;
|
|||
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|||
|
|
daoCategory.Update(strID, "GGEnable", 1);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (strs == "2")
|
|||
|
|
{
|
|||
|
|
Mtxfw.Model.P_Category model = daoCategory.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.C_NAME + "";
|
|||
|
|
logmodel.UType = 0;
|
|||
|
|
logmodel.gtype = gtype;
|
|||
|
|
new DAL.User_CZ_log().Add(logmodel);
|
|||
|
|
daoCategory.Update(strID, "GGEnable", 0);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
Data_Bind();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|