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

187 lines
8.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace Mtxfw.WebSite._Admin
{
public partial class Admin_Member_business0_list : Mtxfw.Utility.MemberBase
{
public Mtxfw.DAL.business_info daoBus = new Mtxfw.DAL.business_info();
DAL.user_Goods_lb daolb = new DAL.user_Goods_lb();
DAL.P_Product daoProduct = new DAL.P_Product();
DAL.user_info daoUser = new DAL.user_info();
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config("");
public int gtype = 0;
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (Session["IFPassword"] == null)
{
Response.Redirect("/Member_IFPassword.aspx?Url=/Admin_Member_business0_list.aspx");
}
if (IFStores != 1)
{
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
}
if (MemberJS.IndexOf("联盟部管理") == -1)
{
Mtxfw.Utility.Tools.Message("您没有权限!", "/gl.aspx");
}
if (!IsPostBack)
{
Select_Bind();
Data_Bind();
}
MyPager.PageChanged += delegate(object s, EventArgs ex)
{
Data_Bind();
};
}
protected void Data_Bind()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
String cls = Request.QueryString["cls"];
String key = HttpUtility.UrlDecode(Request.QueryString["key"]);
String state = HttpUtility.UrlDecode(Request.QueryString["state"]);
if (!String.IsNullOrEmpty(cls) && cls != "-1")
{
sb.Append("and ClsID=" + cls);
Drop_Cls.SelectedValue = cls;
}
if (!String.IsNullOrEmpty(state) && state != "所有状态")
{
if (state == "已审核")
{
sb.Append("and seef=1");
}
if (state == "未审核")
{
sb.Append("and seef=0");
}
Drop_State.Text = state;
}
if (!String.IsNullOrEmpty(key))
{
if (System.Text.RegularExpressions.Regex.IsMatch(key, @"^[1]+[1,2,3,4,5,6,7,8,9]+\d{9}$"))
{
sb.Append("and UserID in (select id from user_info b where b.IFStores=0 and b.UserName like '%" + key + "%')");
}
else
{
sb.Append("and CompanyName like '%" + key + "%'");
}
}
string strOrder = " Order by ApplyTime desc";
MyPager.PageSize = 50;
MyPager.RecordCount = daoBus.GetCount("utype='2'" + sb.ToString());
if (MyPager.RecordCount == 0)
{
MyPager.Visible = false;
}
Mtxfw.Utility.Tools.ToBind(Repeater1, daoBus.GetPager(MyPager, "(Select UserName From user_info b Where b.Id=a.UserId) as UserName,(Select realname From user_info b Where b.Id=a.UserId) as realname,(Select umoney39 From user_info b Where b.Id=a.UserId) as umoney39,(Select umoney40 From user_info b Where b.Id=a.UserId) as umoney40,(Select umoney41 From user_info b Where b.Id=a.UserId) as umoney41,", "utype='2'" + sb.ToString() + strOrder));
}
protected void Select_Bind()
{
DataSet ds = daolb.GetList("gtype=" + gtype + " and utype=2 Order By LBLinkID");
foreach (System.Data.DataRow Dr in ds.Tables[0].Rows)
{
Drop_Cls.Items.Add(new ListItem(Dr["LBName"].ToString(), Dr["id"].ToString()));
}
ds.Clear();
}
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)
{
Mtxfw.Model.business_info model = daoBus.GetModel(strID);
if (model != null)
{
if (strs == "0")
{
daoBus.UpdateSel("seef", 1, strID);
daoUser.UpdateuLevel("uLevel30", 2, model.UserId);
}
else if (strs == "1")
{
daoBus.UpdateSel("seef", 0, strID);
daoUser.UpdateuLevel("uLevel30", 0, model.UserId);
}
else if (strs == "14")
{
daoUser.UpdateuLevel("uLevel30", 0, model.UserId);
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.CompanyName;
logmodel.UType = 0;
logmodel.gtype = gtype;
new DAL.User_CZ_log().Add(logmodel);
daoBus.Delete(strID);
}
}
}
}
System.Collections.IDictionaryEnumerator CacheEnum = Cache.GetEnumerator();
while (CacheEnum.MoveNext())
{
Cache.Remove(CacheEnum.Key.ToString());
}
Response.Redirect(Request.Url.AbsoluteUri);
}
public string cuploadimages(string uploadimages)
{
string str = "";
string[] auploadimages = uploadimages.Split('|');
for (int i = 0; i < auploadimages.Length; i++)
{
if (auploadimages[i] != "")
{
string src = auploadimages[i], src0 = auploadimages[i];
if (auploadimages[i].IndexOf("https://vip.ksd2023.com") != -1)
{
src = "https://vip.ksd2023.com/GetFiles.ashx?image=" + auploadimages[i].Replace("https://vip.ksd2023.com", "").Replace("Files/Image/", "") + "&itsize=100x100&itmode=cut";
src0 = "https://vip.ksd2023.com/GetFiles.ashx?image=" + auploadimages[i].Replace("https://vip.ksd2023.com", "").Replace("Files/Image/", "") + "&itsize=10000x10000&itmode=cut";
}
else if (auploadimages[i].IndexOf("https://www.pmhapp.cn") != -1)
{
src = "https://www.pmhapp.cn/GetFiles.ashx?image=" + auploadimages[i].Replace("https://www.pmhapp.cn", "").Replace("Files/Image/", "") + "&itsize=100x100&itmode=cut";
src0 = "https://www.pmhapp.cn/GetFiles.ashx?image=" + auploadimages[i].Replace("https://www.pmhapp.cn", "").Replace("Files/Image/", "") + "&itsize=10000x10000&itmode=cut";
}
else
{
if (auploadimages[i].IndexOf("https://") == -1 && auploadimages[i].IndexOf("http") == -1)
{
src = "/GetFiles.ashx?image=" + auploadimages[i].Replace("Files/Image/", "") + "&itsize=100x100&itmode=cut";
src0 = "/GetFiles.ashx?image=" + auploadimages[i].Replace("Files/Image/", "") + "&itsize=10000x10000&itmode=cut";
}
}
str += ("<a href=\"" + src0 + "\" target=\"_blank\"><img src=\"" + src + "\" /></a>");
}
}
return str;
}
}
}