📄 movemember.aspx.cs
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using YXShop.Common;
using Shop.Web.UI;
namespace YXShop.Web.Admin.Consumer
{
public partial class MoveMember : System.Web.UI.Page
{
BasePage bp = new BasePage();
YXShop.BLL.MemberRand dataCAa = new YXShop.BLL.MemberRand();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
YXShop.BLL.UserCommon datau = new YXShop.BLL.UserCommon();
string StrId = Request.QueryString["strId"];
if (StrId != null)
{
string[] id = StrId.Split(',');
int ln = id.Length;
string str = "";
for (int i = 0; i < id.Length; i++)
{
if (!id[i].Trim().Equals(""))
{
try
{
List<YXShop.Model.UserCommon> datam = datau.GetListByColumn("UID", id[i]);
if (datam.Count > 0)
{
str += datam[0].UserName + ",";
}
}
catch
{
continue;
}
}
}
//if (Session["strnmxx"] != null)
//{
try
{
TextBox1.Text = str.Substring(0, (str.Length - 1));
}
catch
{
}
RadioButton3.Checked = true;
ViewState["m"] = "3";
}
grid();
}
}
protected void grid()
{
ListBox1.DataSource = dataCAa.GetAll();
ListBox1.DataTextField = "Rank_name";
ListBox1.DataValueField = "Rank_ID";
ListBox1.DataBind();
ListBox2.DataSource = dataCAa.GetAll();
ListBox2.DataTextField = "Rank_name";
ListBox2.DataValueField = "Rank_ID";
ListBox2.DataBind();
}
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
hyzid1 = Convert.ToInt32(ListBox1.SelectedValue.ToString());
}
int hyzid1;
int hyzid;
protected void ListBox2_SelectedIndexChanged(object sender, EventArgs e)
{
hyzid = Convert.ToInt32(ListBox2.SelectedValue.ToString());
}
protected void RadioButton3_CheckedChanged(object sender, EventArgs e)
{
ViewState["m"] = "3";
}
protected void RadioButton4_CheckedChanged(object sender, EventArgs e)
{
ViewState["m"] = "4";
}
protected void Button1_Click(object sender, EventArgs e)
{
if (hyzid.ToString() == string.Empty)
{
Label1.Text = "请指定目标会员组!!";
}
else
{
YXShop.BLL.MemberInfo dataCAy = new YXShop.BLL.MemberInfo();
YXShop.Model.MemberInfo datadd = new YXShop.Model.MemberInfo();
YXShop.BLL.UserCommon datakj = new YXShop.BLL.UserCommon();
if (ViewState["m"].ToString() == "3")
{
string hym = TextBox1.Text.Trim();
String[] sjrid = hym.Split(',');
int con = sjrid.Length;
string strdm;
strdm = "";
string strcg;
strcg = "";
for (int i = 0; i < con; i++)
{
string bn = sjrid[i].ToString();//会员名称
List<YXShop.Model.UserCommon> dataye = datakj.GetListByColumn("UserName",bn);
List<YXShop.Model.MemberInfo> model = dataCAy.GetListByColumn("UID",dataye[0].UID.ToString());
if (model.Count > 0)
{
datadd.uGroupId = hyzid;
//datadd.Uid = Convert.ToInt32(dataCAy.Getnm(bn).uUserId.ToString());
datadd.Uid = model[0].Uid;
dataCAy.Amendhyz(datadd);
int j;
j = i - 1;
string cdm1 = sjrid[i].ToString();
string cdm2;
if (i > 0)
{
cdm2 = sjrid[i].ToString();
}
else
{
cdm2 = sjrid[i].ToString();
}
if (i == 0)
{
strcg = cdm1;
}
else
{
if (strcg == "")
{
strcg = cdm1;
}
else
{
strcg = strcg + "," + cdm1;
}
}
}
else
{
int j;
j = i - 1;
string cdm1 = sjrid[i].ToString();
string cdm2;
if (i > 0)
{
cdm2 = sjrid[i].ToString();
}
else
{
cdm2 = sjrid[i].ToString();
}
if (i == 0)
{
strdm = cdm1;
}
else
{
if (strdm == "")
{
strdm = cdm1;
}
else
{
strdm = strdm + "," + cdm1;
}
}
}
}
Session["strdm"] = strdm;
Session["strcg"] = strcg;
}
if (ViewState["m"].ToString() == "4")
{
datadd.uGroupId = hyzid1;
datadd.fIntegral = hyzid;
dataCAy.Amendhyz(datadd);
}
//HttpContext.Current.Response.Redirect("good.aspx");
bp.PageRight("会员组移动", "MemberAllList.aspx");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -