子账号管理相关内容
This commit is contained in:
1 parent
9fe9fa2610
commit
b48f320099
101 files changed
+3171
-572
No files matched your search
@@ -40,7 +40,7 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
flpNotSubAccount.Controls.Clear();
|
||||
flpShopSubAccount.Controls.Clear();
|
||||
AllSubAccountList.Clear();
|
||||
string url = BaseClass.BuildObjString("user&act=get");
|
||||
string url = BaseClass.BuildObjString("user/get_sub_user");
|
||||
string data = UserLogin.GetSignaturex();
|
||||
string html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html))
|
||||
@@ -53,7 +53,8 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
string oStr = JsonHelper.SerializeObject(obj);
|
||||
DouShopSubAccountInfo user = new DouShopSubAccountInfo();
|
||||
user.id = BaseRegex.GetIntJson(ref oStr, "id");
|
||||
user.name = BaseRegex.GetStringJson(ref oStr, "name");
|
||||
user.nick_name = BaseRegex.GetStringJson(ref oStr, "nick_name");
|
||||
user.user_name = BaseRegex.GetStringJson(ref oStr, "user_name");
|
||||
user.mobile = BaseRegex.GetStringJson(ref oStr, "mobile");
|
||||
user.group_id = BaseRegex.GetStringJson(ref oStr, "group_id");
|
||||
user.shop_count = BaseRegex.GetIntJson(ref oStr, "shop_count");
|
||||
@@ -63,7 +64,10 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
|
||||
if (shop != null)
|
||||
{
|
||||
ShopSubAccountList.AddRange(shop.ShopSubAccountList);
|
||||
ShopSubAccountList.Clear();
|
||||
ShopSubAccountList.AddRange(AllSubAccountList.Where(u=>shop.SubUserName==u.sub_user_name));
|
||||
shop.ShopSubAccountList.Clear();
|
||||
shop.ShopSubAccountList.AddRange(ShopSubAccountList);
|
||||
NotShopSubAccountList.AddRange(AllSubAccountList.Where(u => !ShopSubAccountList.Any(bu => bu.id == u.id)));
|
||||
foreach (var item in ShopSubAccountList)
|
||||
{
|
||||
@@ -88,6 +92,13 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
var s = obj as UcSubAccount;
|
||||
if (s != null)
|
||||
{
|
||||
if (this.flpShopSubAccount.Controls.Count > 0)
|
||||
{
|
||||
BaseMsgForm.ShowInfo("只能有一个子账户!");
|
||||
s.lblRight_Click(null, null);
|
||||
return;
|
||||
}
|
||||
|
||||
this.flpNotSubAccount.Controls.Remove(s);
|
||||
this.flpShopSubAccount.Controls.Add(s);
|
||||
}
|
||||
@@ -135,13 +146,14 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
{
|
||||
DeleteUsers.Add(co.subAccount);
|
||||
shop.ShopSubAccountList.Remove(co.subAccount);
|
||||
string url = BaseClass.BuildObjString("shop&act=delete_shop_user_sub_group");
|
||||
string data = UserLogin.GetSignaturex()
|
||||
+ "&shop_id=" + shop.ShopId
|
||||
+ "&sub_user_id=" + co.subAccount.sub_user_id
|
||||
+ "&status=" + co.subAccount.status
|
||||
+ "&group_id=" + co.subAccount.group_id;
|
||||
string html = GetHtml.PostUtf8(url, data);
|
||||
//string url = BaseClass.BuildObjString("shop&act=delete_shop_user_sub_group");
|
||||
//string data = UserLogin.GetSignaturex()
|
||||
// + "&shop_id=" + shop.ShopId
|
||||
// + "&sub_user_id=" + co.subAccount.sub_user_id
|
||||
// + "&sub_user_name=" + co.subAccount.sub_user_name
|
||||
// + "&status=" + co.subAccount.status
|
||||
// + "&group_id=" + co.subAccount.group_id;
|
||||
//string html = GetHtml.PostUtf8(url, data);
|
||||
}
|
||||
}
|
||||
foreach (Control c in this.flpShopSubAccount.Controls)
|
||||
@@ -154,15 +166,26 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
{
|
||||
AddUsers.Add(co.subAccount);
|
||||
shop.ShopSubAccountList.Add(co.subAccount);
|
||||
string url = BaseClass.BuildObjString("shop&act=update_shop_user_sub_group");
|
||||
string data = UserLogin.GetSignaturex()
|
||||
+ "&shop_id=" + shop.ShopId
|
||||
+ "&sub_user_id=" + co.subAccount.sub_user_id
|
||||
+ "&status=" + co.subAccount.status
|
||||
+ "&group_id=" + co.subAccount.group_id;
|
||||
string html = GetHtml.PostUtf8(url, data);
|
||||
//string url = BaseClass.BuildObjString("shop&act=update_shop_user_sub_group");
|
||||
//string data = UserLogin.GetSignaturex()
|
||||
// + "&shop_id=" + shop.ShopId
|
||||
// + "&sub_user_id=" + co.subAccount.sub_user_id
|
||||
// + "&sub_user_name=" + co.subAccount.sub_user_name
|
||||
// + "&status=" + co.subAccount.status
|
||||
// + "&group_id=" + co.subAccount.group_id;
|
||||
//string html = GetHtml.PostUtf8(url, data);
|
||||
}
|
||||
}
|
||||
|
||||
shop.SubUserName = shop.ShopSubAccountList.FirstOrDefault()?.sub_user_name;
|
||||
var shopLst = AllBase.Helper.GlobalConfig.ShopLoginList.Where(s => s.LoginName == shop.LoginName && s.ShopId!= shop.ShopId);
|
||||
foreach(var s in shopLst)
|
||||
{
|
||||
s.SubUserName = shop.SubUserName;
|
||||
s.ShopSubAccountList.Clear();
|
||||
shop.ShopSubAccountList.AddRange(s.ShopSubAccountList);
|
||||
}
|
||||
|
||||
OnSaveComplete(shop);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user