修改用户oem

This commit is contained in:
chfei committed 2026-11-19 18:52:21 +08:00
1 parent 053fddaf1d
commit 9a4e595d76
3 files changed
+124 -48

No files matched your search

@@ -1,6 +1,7 @@
using AllBase;
using AllBase.Model.Result;
using NaiBa.Util.Extension;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -10,11 +11,15 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
using System.Windows.Forms;
using TemuKJD.BaseForms;
using TemuKJD.BLL;
using TemuKJD.Extension;
using TemuKJD.KJDForms.ShopForms;
using TemuKJD.UserComponent;
using TemuKJD.UserControls;
using TemuKJD.WXForms.ShopForms;
using Work;
namespace TemuKJD.WXForms.AdminForms
@@ -25,7 +30,7 @@ namespace TemuKJD.WXForms.AdminForms
public static List<UserSubAccountInfo> AllUsers { get; set; } = new List<UserSubAccountInfo>();
public MainForm Mf { get; set; } = null;
public string Uid { get; set; } = "";
private DataGridViewRow SelectedRow { get; set; }
public WXAdminAccountForm()
{
InitializeComponent();
@@ -255,6 +260,7 @@ namespace TemuKJD.WXForms.AdminForms
txtMobile.Clear();
txtCompany.Clear();
txtOemId.Clear();
txtOemId.Enabled = true;
cmbGroup.Text = "主账户";
cmbSaLevel.Text = "普通用户";
chkWXComplateProd.Checked = false;
@@ -310,7 +316,7 @@ namespace TemuKJD.WXForms.AdminForms
btnCancel.Visible = true;
cmbSaLevel.Text = saLevelName;
txtOemId.Text = oemId;
txtOemId.Enabled = false;
chkWXComplateProd.Checked = authority.Contains(chkWXComplateProd.Text);
chkShopPoints.Checked = authority.Contains(chkShopPoints.Text);
chkProdFission.Checked = authority.Contains(chkProdFission.Text);
@@ -424,6 +430,17 @@ namespace TemuKJD.WXForms.AdminForms
this.lblSyncLogisticsPerOrderUserId.Text = uid;
}
}
if (columName == "colCheck")
{
foreach (DataGridViewRow item in dgvUser.Rows)
{
item.Cells["colCheck"].Value = false;
}
SelectedRow = dgvUser.Rows[e.RowIndex];
SelectedRow.Cells["colCheck"].Value = true;
}
}
public void Delete(string uid)
@@ -803,5 +820,45 @@ namespace TemuKJD.WXForms.AdminForms
{
pnlSyncLogisticsPerOrder.Visible = false;
}
private async void btnUdpateOEM_Click(object sender, EventArgs e)
{
try
{
btnUdpateOEM.Enabled = false;
if (SelectedRow == null)
{
BaseMsgForm.ShowError("必须选择一条");
return;
}
string userName = SelectedRow.Cells["mobileColumn"].Value.ToString();
if (string.IsNullOrEmpty(userName))
{
BaseMsgForm.ShowError("错误无账户");
return;
}
string newOemId = InputDialog.Show("新代理编码", "修改", "");
if (newOemId == null) return;
string url = BaseClass.BuildWXObjString("user/update_user_oem");
var data = UserLogin.GetSignPostData(new
{
TargetUserName = userName,
OemId = newOemId
});
var html = await GetHtml.PostJsonAsync(url, data);
var result = JsonConvert.DeserializeObject<Result>(html);
if (result.Code != 200) throw new Exception(result.Msg);
BaseMsgForm.ShowInfo("修改成功");
}
catch (Exception ex)
{
BaseMsgForm.ShowError(ex.Message);
}
finally
{
btnUdpateOEM.Enabled = true;
}
}
}
}