超管批量删除店铺功能

This commit is contained in:
wule committed 2026-10-20 18:33:44 +08:00
1 parent 2373b94444
commit e0eec7a463
2 files changed
+116 -58

No files matched your search

+85 -57
View File
@@ -38,6 +38,7 @@ namespace TemuKJD.WXForms.AdminForms
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.panel5 = new System.Windows.Forms.Panel(); this.panel5 = new System.Windows.Forms.Panel();
this.btnDelSelect = new DevComponents.DotNetBar.PanelEx();
this.btnLoginSelect = new DevComponents.DotNetBar.PanelEx(); this.btnLoginSelect = new DevComponents.DotNetBar.PanelEx();
this.chkShowDelete = new System.Windows.Forms.CheckBox(); this.chkShowDelete = new System.Windows.Forms.CheckBox();
this.btnCheck = new DevComponents.DotNetBar.PanelEx(); this.btnCheck = new DevComponents.DotNetBar.PanelEx();
@@ -68,10 +69,6 @@ namespace TemuKJD.WXForms.AdminForms
this.btnRemainOK = new DevComponents.DotNetBar.PanelEx(); this.btnRemainOK = new DevComponents.DotNetBar.PanelEx();
this.lblAddProdRemaining = new System.Windows.Forms.Label(); this.lblAddProdRemaining = new System.Windows.Forms.Label();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx(); this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.chkAutoDrag = new System.Windows.Forms.CheckBox();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.panel3 = new System.Windows.Forms.Panel();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -104,6 +101,10 @@ namespace TemuKJD.WXForms.AdminForms
this.colEdit = new System.Windows.Forms.DataGridViewLinkColumn(); this.colEdit = new System.Windows.Forms.DataGridViewLinkColumn();
this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn(); this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn();
this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.chkAutoDrag = new System.Windows.Forms.CheckBox();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.panel3 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
@@ -161,21 +162,47 @@ namespace TemuKJD.WXForms.AdminForms
// //
// panel5 // panel5
// //
this.panel5.Controls.Add(this.btnDelSelect);
this.panel5.Controls.Add(this.btnLoginSelect); this.panel5.Controls.Add(this.btnLoginSelect);
this.panel5.Controls.Add(this.chkShowDelete); this.panel5.Controls.Add(this.chkShowDelete);
this.panel5.Controls.Add(this.btnCheck); this.panel5.Controls.Add(this.btnCheck);
this.panel5.Location = new System.Drawing.Point(1008, 3); this.panel5.Location = new System.Drawing.Point(1008, 3);
this.panel5.Name = "panel5"; this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(260, 40); this.panel5.Size = new System.Drawing.Size(260, 64);
this.panel5.TabIndex = 1; this.panel5.TabIndex = 1;
// //
// btnDelSelect
//
this.btnDelSelect.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnDelSelect.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnDelSelect.DisabledBackColor = System.Drawing.Color.Empty;
this.btnDelSelect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelSelect.Location = new System.Drawing.Point(191, 38);
this.btnDelSelect.Name = "btnDelSelect";
this.btnDelSelect.Size = new System.Drawing.Size(66, 23);
this.btnDelSelect.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnDelSelect.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnDelSelect.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnDelSelect.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnDelSelect.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnDelSelect.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnDelSelect.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnDelSelect.Style.GradientAngle = 90;
this.btnDelSelect.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnDelSelect.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnDelSelect.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnDelSelect.TabIndex = 477;
this.btnDelSelect.Text = "删除选中";
this.btnDelSelect.Visible = false;
this.btnDelSelect.Click += new System.EventHandler(this.btnDelSelect_Click);
//
// btnLoginSelect // btnLoginSelect
// //
this.btnLoginSelect.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnLoginSelect.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnLoginSelect.Cursor = System.Windows.Forms.Cursors.Hand; this.btnLoginSelect.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnLoginSelect.DisabledBackColor = System.Drawing.Color.Empty; this.btnLoginSelect.DisabledBackColor = System.Drawing.Color.Empty;
this.btnLoginSelect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnLoginSelect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLoginSelect.Location = new System.Drawing.Point(192, 12); this.btnLoginSelect.Location = new System.Drawing.Point(191, 12);
this.btnLoginSelect.Name = "btnLoginSelect"; this.btnLoginSelect.Name = "btnLoginSelect";
this.btnLoginSelect.Size = new System.Drawing.Size(66, 23); this.btnLoginSelect.Size = new System.Drawing.Size(66, 23);
this.btnLoginSelect.Style.Alignment = System.Drawing.StringAlignment.Center; this.btnLoginSelect.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -190,7 +217,7 @@ namespace TemuKJD.WXForms.AdminForms
this.btnLoginSelect.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); this.btnLoginSelect.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnLoginSelect.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); this.btnLoginSelect.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnLoginSelect.TabIndex = 467; this.btnLoginSelect.TabIndex = 467;
this.btnLoginSelect.Text = "检测选中"; this.btnLoginSelect.Text = "登录选中";
this.btnLoginSelect.Click += new System.EventHandler(this.btnLoginSelect_Click); this.btnLoginSelect.Click += new System.EventHandler(this.btnLoginSelect_Click);
// //
// chkShowDelete // chkShowDelete
@@ -672,56 +699,6 @@ namespace TemuKJD.WXForms.AdminForms
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick); this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
this.dgvShop.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvShop_CellMouseDown); this.dgvShop.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvShop_CellMouseDown);
// //
// chkAutoDrag
//
this.chkAutoDrag.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.chkAutoDrag.AutoSize = true;
this.chkAutoDrag.BackColor = System.Drawing.Color.White;
this.chkAutoDrag.Location = new System.Drawing.Point(595, 0);
this.chkAutoDrag.Name = "chkAutoDrag";
this.chkAutoDrag.Size = new System.Drawing.Size(159, 21);
this.chkAutoDrag.TabIndex = 3;
this.chkAutoDrag.Text = "登录时自动滑动拼图验证";
this.chkAutoDrag.UseVisualStyleBackColor = false;
this.chkAutoDrag.Visible = false;
//
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = true;
this.ucSplitPage1.IsShowTotalCount = false;
this.ucSplitPage1.Location = new System.Drawing.Point(882, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.MaxPageSizeValue = 5000;
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(389, 25);
this.ucSplitPage1.TabIndex = 4;
this.ucSplitPage1.TotalCount = ((long)(0));
this.ucSplitPage1.TotalPage = 1;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1271, 25);
this.statusBar.TabIndex = 1;
//
// panel3
//
this.panel3.BackColor = System.Drawing.Color.White;
this.panel3.Controls.Add(this.splitContainer1);
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel3.Location = new System.Drawing.Point(1, 33);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(1271, 576);
this.panel3.TabIndex = 35;
//
// colSelect // colSelect
// //
this.colSelect.FillWeight = 21.69699F; this.colSelect.FillWeight = 21.69699F;
@@ -993,6 +970,56 @@ namespace TemuKJD.WXForms.AdminForms
this.colMsg.ReadOnly = true; this.colMsg.ReadOnly = true;
this.colMsg.Visible = false; this.colMsg.Visible = false;
// //
// chkAutoDrag
//
this.chkAutoDrag.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.chkAutoDrag.AutoSize = true;
this.chkAutoDrag.BackColor = System.Drawing.Color.White;
this.chkAutoDrag.Location = new System.Drawing.Point(595, 0);
this.chkAutoDrag.Name = "chkAutoDrag";
this.chkAutoDrag.Size = new System.Drawing.Size(159, 21);
this.chkAutoDrag.TabIndex = 3;
this.chkAutoDrag.Text = "登录时自动滑动拼图验证";
this.chkAutoDrag.UseVisualStyleBackColor = false;
this.chkAutoDrag.Visible = false;
//
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = true;
this.ucSplitPage1.IsShowTotalCount = false;
this.ucSplitPage1.Location = new System.Drawing.Point(882, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.MaxPageSizeValue = 5000;
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(389, 25);
this.ucSplitPage1.TabIndex = 4;
this.ucSplitPage1.TotalCount = ((long)(0));
this.ucSplitPage1.TotalPage = 1;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1271, 25);
this.statusBar.TabIndex = 1;
//
// panel3
//
this.panel3.BackColor = System.Drawing.Color.White;
this.panel3.Controls.Add(this.splitContainer1);
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel3.Location = new System.Drawing.Point(1, 33);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(1271, 576);
this.panel3.TabIndex = 35;
//
// WXAdminShopListForm // WXAdminShopListForm
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1103,5 +1130,6 @@ namespace TemuKJD.WXForms.AdminForms
private System.Windows.Forms.DataGridViewLinkColumn colEdit; private System.Windows.Forms.DataGridViewLinkColumn colEdit;
private System.Windows.Forms.DataGridViewLinkColumn colDelete; private System.Windows.Forms.DataGridViewLinkColumn colDelete;
private System.Windows.Forms.DataGridViewTextBoxColumn colMsg; private System.Windows.Forms.DataGridViewTextBoxColumn colMsg;
private DevComponents.DotNetBar.PanelEx btnDelSelect;
} }
} }
@@ -1,6 +1,8 @@
using AllBase; using AllBase;
using AllBase.Helper;
using AllBase.Model.Param.TemuProductManage; using AllBase.Model.Param.TemuProductManage;
using AllBase.Model.Result; using AllBase.Model.Result;
using CefSharp.DevTools.FedCm;
using NaiBa.Util; using NaiBa.Util;
using NaiBa.Util.Extension; using NaiBa.Util.Extension;
using Newtonsoft.Json; using Newtonsoft.Json;
@@ -17,6 +19,7 @@ using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web.UI.WebControls;
using System.Windows.Forms; using System.Windows.Forms;
using TemuKJD.BaseForms; using TemuKJD.BaseForms;
using TemuKJD.BLL; using TemuKJD.BLL;
@@ -201,7 +204,7 @@ namespace TemuKJD.WXForms.AdminForms
break; break;
var shopInfo = lstAdminShopInfo.FirstOrDefault(v => v.LoginName == loginName); var shopInfo = lstAdminShopInfo.FirstOrDefault(v => v.LoginName == loginName);
if (shopInfo != null && !string.IsNullOrEmpty(shopInfo.LoginName) && !string.IsNullOrEmpty(shopInfo.Password)) if (shopInfo != null && !string.IsNullOrEmpty(shopInfo.LoginName) /*&& !string.IsNullOrEmpty(shopInfo.Password)*/)
{ {
WXAdminShopLoginForm shopLoginForm = new WXAdminShopLoginForm(shopInfo); WXAdminShopLoginForm shopLoginForm = new WXAdminShopLoginForm(shopInfo);
shopLoginForm.openType = EnumOpenType.login; shopLoginForm.openType = EnumOpenType.login;
@@ -578,11 +581,13 @@ namespace TemuKJD.WXForms.AdminForms
{ {
this.dgvShop.Columns["colEdit"].Visible = true; this.dgvShop.Columns["colEdit"].Visible = true;
this.dgvShop.Columns["colDelete"].Visible = true; this.dgvShop.Columns["colDelete"].Visible = true;
this.btnDelSelect.Visible = true;
} }
else else
{ {
this.dgvShop.Columns["colEdit"].Visible = false; this.dgvShop.Columns["colEdit"].Visible = false;
this.dgvShop.Columns["colDelete"].Visible = false; this.dgvShop.Columns["colDelete"].Visible = false;
this.btnDelSelect.Visible = false;
} }
} }
@@ -802,6 +807,31 @@ namespace TemuKJD.WXForms.AdminForms
this.pbLoading.Visible = false; this.pbLoading.Visible = false;
} }
} }
private void btnDelSelect_Click(object sender, EventArgs e)
{
if (BaseMsgForm.ShowConfirm("确定删除店铺吗?删除后不可恢复!").DialogResult == DialogResult.Cancel)
return;
var shopLoginNameList = dgvShop.Rows.Cast<DataGridViewRow>().Where(c => c.Cells["colSelect"].Value.ParseToBool() == true).ToList();
if (!shopLoginNameList.Any())
{
BaseMsgForm.ShowError("请选择需要检测的店铺");
return;
}
Task.Run(() =>
{
foreach (var dgvRow in shopLoginNameList)
{
Thread.Sleep(50);
var shop = lstAdminShopInfo.FirstOrDefault(v => v.UserName == dgvRow.Cells["colUser"].Value.ParseToString() && v.ShopId == dgvRow.Cells["colShopId"].Value.ParseToString());
ShopBLL.AdminDelServerShop(shop);
}
SearchShop(this.ucSplitPage1.CurrentPage);
});
}
} }