diff --git a/TEMUKJD/KJD.csproj b/TEMUKJD/KJD.csproj
index c84f8bc..0ba3a2b 100644
--- a/TEMUKJD/KJD.csproj
+++ b/TEMUKJD/KJD.csproj
@@ -186,11 +186,11 @@
InitForm.cs
-
+
Form
-
- AccountForm.cs
+
+ MainAccountForm.cs
Form
@@ -782,8 +782,8 @@
InitForm.cs
-
- AccountForm.cs
+
+ MainAccountForm.cs
BaseMsgForm.cs
diff --git a/TEMUKJD/KJDForms/AccountForms/AccountForm.cs b/TEMUKJD/KJDForms/AccountForms/AccountForm.cs
deleted file mode 100644
index a943370..0000000
--- a/TEMUKJD/KJDForms/AccountForms/AccountForm.cs
+++ /dev/null
@@ -1,151 +0,0 @@
-using AllBase;
-using AllBase.Model.Result;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using TemuKJD.KJDForms.BaseForms;
-using Work;
-
-namespace TemuKJD.KJDForms.AccountForms
-{
- public partial class AccountForm : Form
- {
- public static List AllUsers { get; set; } = new List();
- public MainForm Mf { get; set; } = null;
- public string Uid { get; set; } = "";
-
- public AccountForm()
- {
- InitializeComponent();
- }
-
- private void btnOpUser_Click(object sender, EventArgs e)
- {
- if (passwordtextBox.Text != repasstextBox.Text)
- {
- BaseMsgForm.ShowInfo("两次密码不正确", "提示");
- return;
- }
- if (btnOpUser.Text == "添加用户" && passwordtextBox.Text.Length < 6)
- {
- BaseMsgForm.ShowInfo("密码最少6位", "提示");
- return;
- }
- if (string.IsNullOrEmpty(txtNickName.Text) || string.IsNullOrEmpty(mobiletextBox.Text) ||
- mobiletextBox.Text.Length != 11)
- {
- BaseMsgForm.ShowInfo("信息不正确", "提示");
- return;
- }
-
- StringBuilder data = new StringBuilder();
- data.Append(UserLogin.GetSignaturex());
- data.Append("&sub_nick_name=" + GetHtml.UrlEncodeUtf8(txtNickName.Text));
- data.Append("&sub_name=" + GetHtml.UrlEncodeUtf8(mobiletextBox.Text));
- data.Append("&sub_mobile=" + GetHtml.UrlEncodeUtf8(mobiletextBox.Text));
- data.Append("&card_id=");
- if (groupIdcomboBox.Text == "客服")
- data.Append("&group_id=4");
- else if (groupIdcomboBox.Text == "采购")
- data.Append("&group_id=9");
- else if (groupIdcomboBox.Text == "主管")
- {
- data.Append("&group_id=3");
- }
- else
- {
- BaseMsgForm.ShowInfo("分组不正确", "提示");
- return;
- }
- //if (groupIdcomboBox.Text == "上货")
- // data.Append("&group_id=10");
- //if (groupIdcomboBox.Text == "数据")
- // data.Append("&group_id=11");
- //if (groupIdcomboBox.Text == "登录")
- // data.Append("&group_id=8");
- if (!string.IsNullOrEmpty(passwordtextBox.Text))
- data.Append("&sub_password=" + Md5Base.GetMd5(passwordtextBox.Text).ToLower());
- string url = BaseClass.BuildObjString("user/add_user");
- if (btnOpUser.Text != "添加用户" && !string.IsNullOrEmpty(Uid))
- {
- data.Append("&id=" + Uid);
- url = BaseClass.BuildObjString("user/update_user");
- }
- string html = GetHtml.PostUtf8(url, data.ToString()).Trim();
-
- if (html == "had" || html == "error had")
- {
- BaseMsgForm.ShowInfo("手机号被占用,请换一个", "提示");
- return;
- }
- if (!string.IsNullOrEmpty(html))
- {
- if (html.Contains("\"code\":200"))
- {
- btnOpUser.Text = "添加用户";
- EmptyInput();
- btnCancel.Visible = false;
- GetUser();
- return;
- }
- var msg = BaseRegex.GetStringJson(ref html, "msg");
- if (string.IsNullOrEmpty(msg))
- msg = html;
- BaseMsgForm.ShowError(msg, "错误");
- return;
- }
- BaseMsgForm.ShowError("出现异常,添加失败", "错误");
- }
-
- private void GetUser()
- {
- dgvUser.Rows.Clear();
- AllUsers.Clear();
- string url = BaseClass.BuildObjString("user/get_user");
- string data = UserLogin.GetSignaturex();
- string html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html))
- return;
- if (html.Contains("\"data\""))
- {
- var userObj = Newtonsoft.Json.Linq.JObject.Parse(html);
- foreach (Newtonsoft.Json.Linq.JObject obj in userObj["data"])
- {
- string oStr = JsonHelper.SerializeObject(obj);
- DouShopSubAccountInfo user = new DouShopSubAccountInfo();
- user.id = BaseRegex.GetIntJson(ref oStr, "id");
- user.user_name = BaseRegex.GetStringJson(ref oStr, "user_name");
- user.nick_name = BaseRegex.GetStringJson(ref oStr, "nick_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");
-
- AllUsers.Add(user);
- dgvUser.Rows.Add(user.id, user.nick_name, user.user_name, user.group_id, user.group_name, user.shop_count, "编辑", "删除");
- }
- }
- }
-
- private void btnCancel_Click(object sender, EventArgs e)
- {
- btnOpUser.Text = "添加用户";
- Uid = "";
- EmptyInput();
- btnCancel.Visible = false;
- }
-
- private void EmptyInput()
- {
- txtNickName.Clear();
- passwordtextBox.Clear();
- repasstextBox.Clear();
- mobiletextBox.Clear();
- }
- }
-}
diff --git a/TEMUKJD/KJDForms/AccountForms/AccountForm.Designer.cs b/TEMUKJD/KJDForms/AccountForms/MainAccountForm.Designer.cs
similarity index 65%
rename from TEMUKJD/KJDForms/AccountForms/AccountForm.Designer.cs
rename to TEMUKJD/KJDForms/AccountForms/MainAccountForm.Designer.cs
index ce15fd8..004f732 100644
--- a/TEMUKJD/KJDForms/AccountForms/AccountForm.Designer.cs
+++ b/TEMUKJD/KJDForms/AccountForms/MainAccountForm.Designer.cs
@@ -1,7 +1,7 @@
namespace TemuKJD.KJDForms.AccountForms
{
- partial class AccountForm
+ partial class MainAccountForm
{
///
/// Required designer variable.
@@ -29,36 +29,45 @@ namespace TemuKJD.KJDForms.AccountForms
///
private void InitializeComponent()
{
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer5 = new System.Windows.Forms.SplitContainer();
+ this.cmbSearchGroup = new System.Windows.Forms.ComboBox();
+ this.label5 = new System.Windows.Forms.Label();
+ this.label4 = new System.Windows.Forms.Label();
+ this.txtSearch = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.txtCompany = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.btnRefresh = new TemuKJD.UserControls.ButtonEx();
this.btnCancel = new TemuKJD.UserControls.ButtonEx();
this.btnOpUser = new TemuKJD.UserControls.ButtonEx();
this.label30 = new System.Windows.Forms.Label();
this.label31 = new System.Windows.Forms.Label();
- this.repasstextBox = new System.Windows.Forms.TextBox();
+ this.txtRePass = new System.Windows.Forms.TextBox();
this.label32 = new System.Windows.Forms.Label();
this.label33 = new System.Windows.Forms.Label();
this.label34 = new System.Windows.Forms.Label();
this.label35 = new System.Windows.Forms.Label();
this.label36 = new System.Windows.Forms.Label();
- this.groupIdcomboBox = new System.Windows.Forms.ComboBox();
+ this.cmbGroup = new System.Windows.Forms.ComboBox();
this.label37 = new System.Windows.Forms.Label();
- this.passwordtextBox = new System.Windows.Forms.TextBox();
+ this.txtPassword = new System.Windows.Forms.TextBox();
this.label38 = new System.Windows.Forms.Label();
- this.mobiletextBox = new System.Windows.Forms.TextBox();
+ this.txtMobile = new System.Windows.Forms.TextBox();
this.label39 = new System.Windows.Forms.Label();
this.txtNickName = new System.Windows.Forms.TextBox();
this.label40 = new System.Windows.Forms.Label();
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.dgvUser = new TemuKJD.UserComponent.DataGridViewEx();
this.UserIdColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.UserNickNameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.mobileColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.groupIdColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.groupNameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.colCompany = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.shopCountColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.editColumn = new System.Windows.Forms.DataGridViewLinkColumn();
this.deleteColumn = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -66,6 +75,9 @@ namespace TemuKJD.KJDForms.AccountForms
this.splitContainer5.Panel1.SuspendLayout();
this.splitContainer5.Panel2.SuspendLayout();
this.splitContainer5.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvUser)).BeginInit();
this.SuspendLayout();
//
@@ -79,43 +91,120 @@ namespace TemuKJD.KJDForms.AccountForms
//
// splitContainer5.Panel1
//
+ this.splitContainer5.Panel1.Controls.Add(this.cmbSearchGroup);
+ this.splitContainer5.Panel1.Controls.Add(this.label5);
+ this.splitContainer5.Panel1.Controls.Add(this.label4);
+ this.splitContainer5.Panel1.Controls.Add(this.txtSearch);
+ this.splitContainer5.Panel1.Controls.Add(this.label3);
+ this.splitContainer5.Panel1.Controls.Add(this.txtCompany);
+ this.splitContainer5.Panel1.Controls.Add(this.label2);
this.splitContainer5.Panel1.Controls.Add(this.label1);
this.splitContainer5.Panel1.Controls.Add(this.btnRefresh);
this.splitContainer5.Panel1.Controls.Add(this.btnCancel);
this.splitContainer5.Panel1.Controls.Add(this.btnOpUser);
this.splitContainer5.Panel1.Controls.Add(this.label30);
this.splitContainer5.Panel1.Controls.Add(this.label31);
- this.splitContainer5.Panel1.Controls.Add(this.repasstextBox);
+ this.splitContainer5.Panel1.Controls.Add(this.txtRePass);
this.splitContainer5.Panel1.Controls.Add(this.label32);
this.splitContainer5.Panel1.Controls.Add(this.label33);
this.splitContainer5.Panel1.Controls.Add(this.label34);
this.splitContainer5.Panel1.Controls.Add(this.label35);
this.splitContainer5.Panel1.Controls.Add(this.label36);
- this.splitContainer5.Panel1.Controls.Add(this.groupIdcomboBox);
+ this.splitContainer5.Panel1.Controls.Add(this.cmbGroup);
this.splitContainer5.Panel1.Controls.Add(this.label37);
- this.splitContainer5.Panel1.Controls.Add(this.passwordtextBox);
+ this.splitContainer5.Panel1.Controls.Add(this.txtPassword);
this.splitContainer5.Panel1.Controls.Add(this.label38);
- this.splitContainer5.Panel1.Controls.Add(this.mobiletextBox);
+ this.splitContainer5.Panel1.Controls.Add(this.txtMobile);
this.splitContainer5.Panel1.Controls.Add(this.label39);
this.splitContainer5.Panel1.Controls.Add(this.txtNickName);
this.splitContainer5.Panel1.Controls.Add(this.label40);
//
// splitContainer5.Panel2
//
- this.splitContainer5.Panel2.Controls.Add(this.dgvUser);
+ this.splitContainer5.Panel2.Controls.Add(this.splitContainer1);
this.splitContainer5.Panel2.Padding = new System.Windows.Forms.Padding(0, 5, 5, 5);
- this.splitContainer5.Size = new System.Drawing.Size(800, 450);
+ this.splitContainer5.Size = new System.Drawing.Size(800, 509);
this.splitContainer5.SplitterDistance = 357;
this.splitContainer5.SplitterWidth = 1;
this.splitContainer5.TabIndex = 3;
//
+ // cmbSearchGroup
+ //
+ this.cmbSearchGroup.FormattingEnabled = true;
+ this.cmbSearchGroup.Items.AddRange(new object[] {
+ "客服",
+ "采购",
+ "上货",
+ "数据",
+ "登录"});
+ this.cmbSearchGroup.Location = new System.Drawing.Point(112, 35);
+ this.cmbSearchGroup.Name = "cmbSearchGroup";
+ this.cmbSearchGroup.Size = new System.Drawing.Size(148, 25);
+ this.cmbSearchGroup.TabIndex = 44;
+ this.cmbSearchGroup.Text = "主账户";
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.label5.Location = new System.Drawing.Point(27, 35);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(79, 20);
+ this.label5.TabIndex = 43;
+ this.label5.Text = "搜索分组:";
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.label4.Location = new System.Drawing.Point(27, 6);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(79, 20);
+ this.label4.TabIndex = 42;
+ this.label4.Text = "搜索条件:";
+ //
+ // txtSearch
+ //
+ this.txtSearch.Location = new System.Drawing.Point(112, 6);
+ this.txtSearch.Name = "txtSearch";
+ this.txtSearch.Size = new System.Drawing.Size(148, 23);
+ this.txtSearch.TabIndex = 41;
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.label3.Location = new System.Drawing.Point(55, 345);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(51, 20);
+ this.label3.TabIndex = 40;
+ this.label3.Text = "公司:";
+ //
+ // txtCompany
+ //
+ this.txtCompany.Location = new System.Drawing.Point(112, 345);
+ this.txtCompany.Name = "txtCompany";
+ this.txtCompany.Size = new System.Drawing.Size(148, 23);
+ this.txtCompany.TabIndex = 39;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.label2.ForeColor = System.Drawing.SystemColors.ButtonShadow;
+ this.label2.Location = new System.Drawing.Point(117, 98);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(135, 20);
+ this.label2.TabIndex = 38;
+ this.label2.Text = "添加或编辑用户账户";
+ //
// label1
//
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.SystemColors.ButtonShadow;
- this.label1.Location = new System.Drawing.Point(56, 378);
+ this.label1.Location = new System.Drawing.Point(56, 446);
this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(209, 12);
+ this.label1.Size = new System.Drawing.Size(212, 17);
this.label1.TabIndex = 37;
this.label1.Text = "编辑时,密码为空表示不更改原密码。";
//
@@ -133,6 +222,7 @@ namespace TemuKJD.KJDForms.AccountForms
this.btnRefresh.TabIndex = 36;
this.btnRefresh.Text = "刷新列表";
this.btnRefresh.UseVisualStyleBackColor = false;
+ this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// btnCancel
//
@@ -141,7 +231,7 @@ namespace TemuKJD.KJDForms.AccountForms
this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.ForeColor = System.Drawing.Color.White;
- this.btnCancel.Location = new System.Drawing.Point(59, 328);
+ this.btnCancel.Location = new System.Drawing.Point(59, 396);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(86, 25);
this.btnCancel.TabIndex = 35;
@@ -157,7 +247,7 @@ namespace TemuKJD.KJDForms.AccountForms
this.btnOpUser.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnOpUser.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpUser.ForeColor = System.Drawing.Color.White;
- this.btnOpUser.Location = new System.Drawing.Point(174, 328);
+ this.btnOpUser.Location = new System.Drawing.Point(174, 396);
this.btnOpUser.Name = "btnOpUser";
this.btnOpUser.Size = new System.Drawing.Size(86, 25);
this.btnOpUser.TabIndex = 34;
@@ -169,9 +259,9 @@ namespace TemuKJD.KJDForms.AccountForms
//
this.label30.AutoSize = true;
this.label30.ForeColor = System.Drawing.SystemColors.ButtonShadow;
- this.label30.Location = new System.Drawing.Point(282, 145);
+ this.label30.Location = new System.Drawing.Point(282, 180);
this.label30.Name = "label30";
- this.label30.Size = new System.Drawing.Size(53, 12);
+ this.label30.Size = new System.Drawing.Size(56, 17);
this.label30.TabIndex = 33;
this.label30.Text = "登录使用";
//
@@ -179,25 +269,25 @@ namespace TemuKJD.KJDForms.AccountForms
//
this.label31.AutoSize = true;
this.label31.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
- this.label31.Location = new System.Drawing.Point(266, 229);
+ this.label31.Location = new System.Drawing.Point(266, 264);
this.label31.Name = "label31";
- this.label31.Size = new System.Drawing.Size(11, 12);
+ this.label31.Size = new System.Drawing.Size(13, 17);
this.label31.TabIndex = 32;
this.label31.Text = "*";
//
- // repasstextBox
+ // txtRePass
//
- this.repasstextBox.Location = new System.Drawing.Point(112, 226);
- this.repasstextBox.Name = "repasstextBox";
- this.repasstextBox.PasswordChar = '*';
- this.repasstextBox.Size = new System.Drawing.Size(148, 21);
- this.repasstextBox.TabIndex = 24;
+ this.txtRePass.Location = new System.Drawing.Point(112, 261);
+ this.txtRePass.Name = "txtRePass";
+ this.txtRePass.PasswordChar = '*';
+ this.txtRePass.Size = new System.Drawing.Size(148, 23);
+ this.txtRePass.TabIndex = 24;
//
// label32
//
this.label32.AutoSize = true;
this.label32.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label32.Location = new System.Drawing.Point(27, 227);
+ this.label32.Location = new System.Drawing.Point(27, 262);
this.label32.Name = "label32";
this.label32.Size = new System.Drawing.Size(79, 20);
this.label32.TabIndex = 31;
@@ -207,9 +297,9 @@ namespace TemuKJD.KJDForms.AccountForms
//
this.label33.AutoSize = true;
this.label33.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
- this.label33.Location = new System.Drawing.Point(266, 271);
+ this.label33.Location = new System.Drawing.Point(266, 306);
this.label33.Name = "label33";
- this.label33.Size = new System.Drawing.Size(11, 12);
+ this.label33.Size = new System.Drawing.Size(13, 17);
this.label33.TabIndex = 30;
this.label33.Text = "*";
//
@@ -217,9 +307,9 @@ namespace TemuKJD.KJDForms.AccountForms
//
this.label34.AutoSize = true;
this.label34.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
- this.label34.Location = new System.Drawing.Point(266, 187);
+ this.label34.Location = new System.Drawing.Point(266, 222);
this.label34.Name = "label34";
- this.label34.Size = new System.Drawing.Size(11, 12);
+ this.label34.Size = new System.Drawing.Size(13, 17);
this.label34.TabIndex = 29;
this.label34.Text = "*";
//
@@ -227,9 +317,9 @@ namespace TemuKJD.KJDForms.AccountForms
//
this.label35.AutoSize = true;
this.label35.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
- this.label35.Location = new System.Drawing.Point(266, 145);
+ this.label35.Location = new System.Drawing.Point(266, 180);
this.label35.Name = "label35";
- this.label35.Size = new System.Drawing.Size(11, 12);
+ this.label35.Size = new System.Drawing.Size(13, 17);
this.label35.TabIndex = 28;
this.label35.Text = "*";
//
@@ -237,68 +327,67 @@ namespace TemuKJD.KJDForms.AccountForms
//
this.label36.AutoSize = true;
this.label36.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
- this.label36.Location = new System.Drawing.Point(266, 103);
+ this.label36.Location = new System.Drawing.Point(266, 138);
this.label36.Name = "label36";
- this.label36.Size = new System.Drawing.Size(11, 12);
+ this.label36.Size = new System.Drawing.Size(13, 17);
this.label36.TabIndex = 27;
this.label36.Text = "*";
//
- // groupIdcomboBox
+ // cmbGroup
//
- this.groupIdcomboBox.Enabled = false;
- this.groupIdcomboBox.FormattingEnabled = true;
- this.groupIdcomboBox.Items.AddRange(new object[] {
+ this.cmbGroup.FormattingEnabled = true;
+ this.cmbGroup.Items.AddRange(new object[] {
"客服",
"采购",
"上货",
"数据",
"登录"});
- this.groupIdcomboBox.Location = new System.Drawing.Point(112, 267);
- this.groupIdcomboBox.Name = "groupIdcomboBox";
- this.groupIdcomboBox.Size = new System.Drawing.Size(148, 20);
- this.groupIdcomboBox.TabIndex = 26;
- this.groupIdcomboBox.Text = "客服";
+ this.cmbGroup.Location = new System.Drawing.Point(112, 302);
+ this.cmbGroup.Name = "cmbGroup";
+ this.cmbGroup.Size = new System.Drawing.Size(148, 25);
+ this.cmbGroup.TabIndex = 26;
+ this.cmbGroup.Text = "主账户";
//
// label37
//
this.label37.AutoSize = true;
this.label37.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label37.Location = new System.Drawing.Point(55, 269);
+ this.label37.Location = new System.Drawing.Point(55, 304);
this.label37.Name = "label37";
this.label37.Size = new System.Drawing.Size(51, 20);
this.label37.TabIndex = 25;
this.label37.Text = "分组:";
//
- // passwordtextBox
+ // txtPassword
//
- this.passwordtextBox.Location = new System.Drawing.Point(112, 184);
- this.passwordtextBox.Name = "passwordtextBox";
- this.passwordtextBox.PasswordChar = '*';
- this.passwordtextBox.Size = new System.Drawing.Size(148, 21);
- this.passwordtextBox.TabIndex = 23;
+ this.txtPassword.Location = new System.Drawing.Point(112, 219);
+ this.txtPassword.Name = "txtPassword";
+ this.txtPassword.PasswordChar = '*';
+ this.txtPassword.Size = new System.Drawing.Size(148, 23);
+ this.txtPassword.TabIndex = 23;
//
// label38
//
this.label38.AutoSize = true;
this.label38.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label38.Location = new System.Drawing.Point(55, 185);
+ this.label38.Location = new System.Drawing.Point(55, 220);
this.label38.Name = "label38";
this.label38.Size = new System.Drawing.Size(51, 20);
this.label38.TabIndex = 22;
this.label38.Text = "密码:";
//
- // mobiletextBox
+ // txtMobile
//
- this.mobiletextBox.Location = new System.Drawing.Point(112, 142);
- this.mobiletextBox.Name = "mobiletextBox";
- this.mobiletextBox.Size = new System.Drawing.Size(148, 21);
- this.mobiletextBox.TabIndex = 21;
+ this.txtMobile.Location = new System.Drawing.Point(112, 177);
+ this.txtMobile.Name = "txtMobile";
+ this.txtMobile.Size = new System.Drawing.Size(148, 23);
+ this.txtMobile.TabIndex = 21;
//
// label39
//
this.label39.AutoSize = true;
this.label39.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label39.Location = new System.Drawing.Point(41, 143);
+ this.label39.Location = new System.Drawing.Point(41, 178);
this.label39.Name = "label39";
this.label39.Size = new System.Drawing.Size(65, 20);
this.label39.TabIndex = 20;
@@ -306,38 +395,53 @@ namespace TemuKJD.KJDForms.AccountForms
//
// txtNickName
//
- this.txtNickName.Location = new System.Drawing.Point(112, 100);
+ this.txtNickName.Location = new System.Drawing.Point(112, 135);
this.txtNickName.Name = "txtNickName";
- this.txtNickName.Size = new System.Drawing.Size(148, 21);
+ this.txtNickName.Size = new System.Drawing.Size(148, 23);
this.txtNickName.TabIndex = 19;
//
// label40
//
this.label40.AutoSize = true;
this.label40.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.label40.Location = new System.Drawing.Point(55, 101);
+ this.label40.Location = new System.Drawing.Point(55, 136);
this.label40.Name = "label40";
this.label40.Size = new System.Drawing.Size(51, 20);
this.label40.TabIndex = 18;
this.label40.Text = "昵称:";
//
+ // splitContainer1
+ //
+ this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
+ this.splitContainer1.Location = new System.Drawing.Point(0, 5);
+ this.splitContainer1.Name = "splitContainer1";
+ this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.dgvUser);
+ this.splitContainer1.Size = new System.Drawing.Size(437, 499);
+ this.splitContainer1.SplitterDistance = 468;
+ this.splitContainer1.TabIndex = 2;
+ //
// dgvUser
//
this.dgvUser.AllowUserToAddRows = false;
this.dgvUser.AllowUserToDeleteRows = false;
- dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
- this.dgvUser.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
+ dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
+ this.dgvUser.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4;
this.dgvUser.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvUser.BackgroundColor = System.Drawing.Color.White;
this.dgvUser.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
- dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
- this.dgvUser.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
+ dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
+ dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
+ dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+ dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+ dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+ this.dgvUser.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
this.dgvUser.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvUser.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.UserIdColumn,
@@ -345,25 +449,27 @@ namespace TemuKJD.KJDForms.AccountForms
this.mobileColumn,
this.groupIdColumn,
this.groupNameColumn,
+ this.colCompany,
this.shopCountColumn,
this.editColumn,
this.deleteColumn});
- dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
- dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;
- dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.ControlText;
- dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
- this.dgvUser.DefaultCellStyle = dataGridViewCellStyle3;
+ dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Window;
+ dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.ControlText;
+ dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+ dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.ControlText;
+ dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+ this.dgvUser.DefaultCellStyle = dataGridViewCellStyle6;
this.dgvUser.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvUser.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229)))));
- this.dgvUser.Location = new System.Drawing.Point(0, 5);
+ this.dgvUser.Location = new System.Drawing.Point(0, 0);
this.dgvUser.Name = "dgvUser";
this.dgvUser.ReadOnly = true;
this.dgvUser.RowTemplate.Height = 23;
- this.dgvUser.Size = new System.Drawing.Size(437, 440);
+ this.dgvUser.Size = new System.Drawing.Size(437, 468);
this.dgvUser.TabIndex = 1;
+ this.dgvUser.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvUser_CellContentClick);
//
// UserIdColumn
//
@@ -397,6 +503,12 @@ namespace TemuKJD.KJDForms.AccountForms
this.groupNameColumn.Name = "groupNameColumn";
this.groupNameColumn.ReadOnly = true;
//
+ // colCompany
+ //
+ this.colCompany.HeaderText = "公司";
+ this.colCompany.Name = "colCompany";
+ this.colCompany.ReadOnly = true;
+ //
// shopCountColumn
//
this.shopCountColumn.HeaderText = "店铺数";
@@ -418,19 +530,24 @@ namespace TemuKJD.KJDForms.AccountForms
this.deleteColumn.Name = "deleteColumn";
this.deleteColumn.ReadOnly = true;
//
- // AccountForm
+ // MainAccountForm
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(800, 450);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.ClientSize = new System.Drawing.Size(800, 509);
this.Controls.Add(this.splitContainer5);
- this.Name = "AccountForm";
+ this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.Name = "MainAccountForm";
this.Text = "AccountForm";
+ this.Load += new System.EventHandler(this.MainAccountForm_Load);
+ this.VisibleChanged += new System.EventHandler(this.MainAccountForm_VisibleChanged);
this.splitContainer5.Panel1.ResumeLayout(false);
this.splitContainer5.Panel1.PerformLayout();
this.splitContainer5.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).EndInit();
this.splitContainer5.ResumeLayout(false);
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+ this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvUser)).EndInit();
this.ResumeLayout(false);
@@ -445,28 +562,37 @@ namespace TemuKJD.KJDForms.AccountForms
private UserControls.ButtonEx btnOpUser;
private System.Windows.Forms.Label label30;
private System.Windows.Forms.Label label31;
- private System.Windows.Forms.TextBox repasstextBox;
+ private System.Windows.Forms.TextBox txtRePass;
private System.Windows.Forms.Label label32;
private System.Windows.Forms.Label label33;
private System.Windows.Forms.Label label34;
private System.Windows.Forms.Label label35;
private System.Windows.Forms.Label label36;
- private System.Windows.Forms.ComboBox groupIdcomboBox;
+ private System.Windows.Forms.ComboBox cmbGroup;
private System.Windows.Forms.Label label37;
- private System.Windows.Forms.TextBox passwordtextBox;
+ private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.Label label38;
- private System.Windows.Forms.TextBox mobiletextBox;
+ private System.Windows.Forms.TextBox txtMobile;
private System.Windows.Forms.Label label39;
private System.Windows.Forms.TextBox txtNickName;
private System.Windows.Forms.Label label40;
private UserComponent.DataGridViewEx dgvUser;
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.TextBox txtCompany;
private System.Windows.Forms.DataGridViewTextBoxColumn UserIdColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn UserNickNameColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn mobileColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn groupIdColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn groupNameColumn;
+ private System.Windows.Forms.DataGridViewTextBoxColumn colCompany;
private System.Windows.Forms.DataGridViewTextBoxColumn shopCountColumn;
private System.Windows.Forms.DataGridViewLinkColumn editColumn;
private System.Windows.Forms.DataGridViewLinkColumn deleteColumn;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.TextBox txtSearch;
+ private System.Windows.Forms.ComboBox cmbSearchGroup;
+ private System.Windows.Forms.Label label5;
}
}
\ No newline at end of file
diff --git a/TEMUKJD/KJDForms/AccountForms/MainAccountForm.cs b/TEMUKJD/KJDForms/AccountForms/MainAccountForm.cs
new file mode 100644
index 0000000..03911e5
--- /dev/null
+++ b/TEMUKJD/KJDForms/AccountForms/MainAccountForm.cs
@@ -0,0 +1,235 @@
+using AllBase;
+using AllBase.Model.Result;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using TemuKJD.KJDForms.BaseForms;
+using Work;
+
+namespace TemuKJD.KJDForms.AccountForms
+{
+ public partial class MainAccountForm : Form
+ {
+ public static List AllUsers { get; set; } = new List();
+ public MainForm Mf { get; set; } = null;
+ public string Uid { get; set; } = "";
+
+ public MainAccountForm()
+ {
+ InitializeComponent();
+ }
+
+ private void btnOpUser_Click(object sender, EventArgs e)
+ {
+ if (txtPassword.Text != txtRePass.Text)
+ {
+ BaseMsgForm.ShowInfo("两次密码不正确", "提示");
+ return;
+ }
+ if (btnOpUser.Text == "添加用户" && txtPassword.Text.Length < 6)
+ {
+ BaseMsgForm.ShowInfo("密码最少6位", "提示");
+ return;
+ }
+ if (string.IsNullOrEmpty(txtNickName.Text) || string.IsNullOrEmpty(txtMobile.Text) ||
+ txtMobile.Text.Length != 11)
+ {
+ BaseMsgForm.ShowInfo("信息不正确", "提示");
+ return;
+ }
+
+ StringBuilder data = new StringBuilder();
+ data.Append(UserLogin.GetSignaturex());
+ data.Append("&add_nick_name=" + GetHtml.UrlEncodeUtf8(txtNickName.Text));
+ data.Append("&add_user_name=" + GetHtml.UrlEncodeUtf8(txtMobile.Text));
+ data.Append("&add_mobile=" + GetHtml.UrlEncodeUtf8(txtMobile.Text));
+ data.Append("&add_company=" + GetHtml.UrlEncodeUtf8(txtCompany.Text));
+ data.Append("&card_id=");
+ if (cmbGroup.Text == "主账户")
+ {
+ data.Append("&group_id=3");
+ }
+ else if(cmbGroup.Text == "客服")
+ {
+ data.Append("&group_id=4");
+ }
+ else
+ {
+ BaseMsgForm.ShowInfo("分组不正确", "提示");
+ return;
+ }
+ if (!string.IsNullOrEmpty(txtPassword.Text))
+ data.Append("&add_password=" + Md5Base.GetMd5(txtPassword.Text).ToLower());
+ string url = BaseClass.BuildObjString("user/add_user");
+ if (btnOpUser.Text != "添加用户" && !string.IsNullOrEmpty(Uid))
+ {
+ data.Append("&id=" + Uid);
+ url = BaseClass.BuildObjString("user/update_user");
+ }
+ string html = GetHtml.PostUtf8(url, data.ToString()).Trim();
+
+ if (!string.IsNullOrEmpty(html))
+ {
+ if (html.Contains("\"code\":200"))
+ {
+ btnOpUser.Text = "添加用户";
+ EmptyInput();
+ btnCancel.Visible = false;
+ GetUser();
+ return;
+ }
+ var msg = BaseRegex.GetStringJson(ref html, "msg");
+ if (string.IsNullOrEmpty(msg))
+ msg = html;
+ BaseMsgForm.ShowError(msg, "错误");
+ return;
+ }
+ BaseMsgForm.ShowError("出现异常,添加失败", "错误");
+ }
+
+ private void GetUser()
+ {
+ dgvUser.Rows.Clear();
+ AllUsers.Clear();
+ string url = BaseClass.BuildObjString("user/get_all_user");
+ StringBuilder data = new StringBuilder();
+ data.Append(UserLogin.GetSignaturex());
+ if (cmbSearchGroup.Text == "主账户")
+ {
+ data.Append("&group_id=3");
+ }
+ else if (cmbSearchGroup.Text == "客服")
+ {
+ data.Append("&group_id=4");
+ }
+ if (!string.IsNullOrWhiteSpace(txtSearch.Text))
+ data.Append("&search=" + txtSearch.Text.Replace("'","'"));
+ string html = GetHtml.PostUtf8(url, data.ToString());
+ if (string.IsNullOrEmpty(html))
+ return;
+ if (html.Contains("\"data\""))
+ {
+ var userObj = Newtonsoft.Json.Linq.JObject.Parse(html);
+ foreach (Newtonsoft.Json.Linq.JObject obj in userObj["data"])
+ {
+ string oStr = JsonHelper.SerializeObject(obj);
+ DouShopSubAccountInfo user = new DouShopSubAccountInfo();
+ user.id = BaseRegex.GetIntJson(ref oStr, "id");
+ user.user_name = BaseRegex.GetStringJson(ref oStr, "user_name");
+ user.nick_name = BaseRegex.GetStringJson(ref oStr, "nick_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");
+ user.company_name = BaseRegex.GetStringJson(ref oStr, "company_name");
+
+ AllUsers.Add(user);
+ dgvUser.Rows.Add(user.id, user.nick_name, user.user_name, user.group_id,
+ user.group_name, user.company_name, user.shop_count, "编辑", "删除");
+ }
+ }
+ }
+
+ private void btnCancel_Click(object sender, EventArgs e)
+ {
+ btnOpUser.Text = "添加用户";
+ Uid = "";
+ EmptyInput();
+ btnCancel.Visible = false;
+ }
+
+ private void EmptyInput()
+ {
+ txtNickName.Clear();
+ txtPassword.Clear();
+ txtRePass.Clear();
+ txtMobile.Clear();
+ txtCompany.Clear();
+ }
+
+ private void btnRefresh_Click(object sender, EventArgs e)
+ {
+ GetUser();
+ }
+
+ private void dgvUser_CellContentClick(object sender, DataGridViewCellEventArgs e)
+ {
+ if (e.ColumnIndex < 0 || e.RowIndex < 0)
+ return;
+ string columname = dgvUser.Columns[e.ColumnIndex].HeaderText;
+ string uid = dgvUser.Rows[e.RowIndex].Cells["UseridColumn"].Value.ToString();
+ string nickName = dgvUser.Rows[e.RowIndex].Cells["UserNickNameColumn"].Value.ToString();
+ string mobile = dgvUser.Rows[e.RowIndex].Cells["mobileColumn"].Value.ToString();
+ string groupName = dgvUser.Rows[e.RowIndex].Cells["groupNameColumn"].Value.ToString();
+ string company = dgvUser.Rows[e.RowIndex].Cells["colCompany"].Value.ToString();
+ if (columname == "编辑")
+ {
+ Uid = uid;
+ txtNickName.Text = nickName;
+ txtMobile.Text = mobile;
+ cmbGroup.Text = groupName;
+ txtPassword.Text = "";
+ txtRePass.Text = "";
+ txtCompany.Text = company;
+ btnOpUser.Text = "保存用户";
+ btnCancel.Visible = true;
+ }
+ if (columname == "删除")
+ {
+ if (BaseMsgForm.ShowConfirm("是否删除,删除后无法再次添加", "提示").DialogResult == DialogResult.OK)
+ {
+ Delete(uid);
+ }
+ }
+ }
+
+ public void Delete(string uid)
+ {
+ StringBuilder data = new StringBuilder();
+ data.Append(UserLogin.GetSignaturex());
+ data.Append("&id=" + uid);
+ string url = BaseClass.BuildObjString("user/delete_user");
+ string html = GetHtml.PostUtf8(url, data.ToString());
+ if (!string.IsNullOrEmpty(html))
+ {
+ if (html.Contains("\"code\":200"))
+ {
+ BaseMsgForm.ShowInfo("删除成功", "提示");
+ GetUser();
+ return;
+ }
+ var msg = BaseRegex.GetStringJson(ref html, "msg");
+ if (string.IsNullOrEmpty(msg))
+ msg = html;
+ BaseMsgForm.ShowError(msg, "错误");
+ return;
+ }
+ BaseMsgForm.ShowError("返回异常", "错误");
+ }
+
+ private void MainAccountForm_VisibleChanged(object sender, EventArgs e)
+ {
+ if (this.Visible)
+ {
+ GetUser();
+ }
+ }
+
+ private void MainAccountForm_Load(object sender, EventArgs e)
+ {
+ this.cmbGroup.Items.Clear();
+ this.cmbGroup.Items.Add("主账户");
+ this.cmbGroup.Items.Add("客服");
+
+ this.cmbSearchGroup.Items.Clear();
+ this.cmbSearchGroup.Items.Add("主账户");
+ this.cmbSearchGroup.Items.Add("客服");
+ this.cmbSearchGroup.Items.Add("全部");
+ }
+ }
+}
diff --git a/TEMUKJD/KJDForms/AccountForms/AccountForm.resx b/TEMUKJD/KJDForms/AccountForms/MainAccountForm.resx
similarity index 97%
rename from TEMUKJD/KJDForms/AccountForms/AccountForm.resx
rename to TEMUKJD/KJDForms/AccountForms/MainAccountForm.resx
index 8daa718..eb2decc 100644
--- a/TEMUKJD/KJDForms/AccountForms/AccountForm.resx
+++ b/TEMUKJD/KJDForms/AccountForms/MainAccountForm.resx
@@ -132,6 +132,9 @@
True
+
+ True
+
True
diff --git a/TEMUKJD/KJDForms/ShopForms/ShopForm.Designer.cs b/TEMUKJD/KJDForms/ShopForms/ShopForm.Designer.cs
index 310a283..59bd19f 100644
--- a/TEMUKJD/KJDForms/ShopForms/ShopForm.Designer.cs
+++ b/TEMUKJD/KJDForms/ShopForms/ShopForm.Designer.cs
@@ -33,12 +33,14 @@
System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("运费模板");
System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("高级运费模板");
System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("素材库管理");
- System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("店铺管理", new System.Windows.Forms.TreeNode[] {
+ System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("超级用户管理");
+ System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("店铺管理", new System.Windows.Forms.TreeNode[] {
treeNode1,
treeNode2,
treeNode3,
treeNode4,
- treeNode5});
+ treeNode5,
+ treeNode6});
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
@@ -139,10 +141,12 @@
treeNode4.Text = "高级运费模板";
treeNode5.Name = "素材库管理";
treeNode5.Text = "素材库管理";
- treeNode6.Name = "店铺管理";
- treeNode6.Text = "店铺管理";
+ treeNode6.Name = "超级用户管理";
+ treeNode6.Text = "超级用户管理";
+ treeNode7.Name = "店铺管理";
+ treeNode7.Text = "店铺管理";
this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
- treeNode6});
+ treeNode7});
this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.tv.Size = new System.Drawing.Size(140, 461);
this.tv.TabIndex = 1;
diff --git a/TEMUKJD/KJDForms/ShopForms/ShopForm.cs b/TEMUKJD/KJDForms/ShopForms/ShopForm.cs
index 1e407d1..21c7ca4 100644
--- a/TEMUKJD/KJDForms/ShopForms/ShopForm.cs
+++ b/TEMUKJD/KJDForms/ShopForms/ShopForm.cs
@@ -9,6 +9,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
+using TemuKJD.KJDForms.AccountForms;
namespace TemuKJD.KJDForms.ShopForms
{
@@ -19,6 +20,7 @@ namespace TemuKJD.KJDForms.ShopForms
public Lazy freightForm = new Lazy();
public Lazy freightTemplateForm = new Lazy();
public Lazy materialManageForm = new Lazy();
+ public Lazy mainAccountForm = new Lazy();
public ShopForm()
{
@@ -29,12 +31,12 @@ namespace TemuKJD.KJDForms.ShopForms
tv.SelectedNode = tv.Nodes[0].Nodes[0];
tv.ExpandGroup(tv.Nodes[0].Name);
- List hideName = new List() { "高级运费模板", "运费模板", "素材库管理" };
+ List hideName = new List() { "高级运费模板", "运费模板", "素材库管理", "超级用户管理" };
if (BaseClass.GroupId != 3)
- {
hideName.Add("用户管理");
- }
+ if (BaseClass.GroupId == 3 && (BaseClass.UserName == "18888888888" || BaseClass.UserName == "15266666666"))
+ hideName.Remove("超级用户管理");
foreach (var item in hideName)
{
@@ -74,6 +76,9 @@ namespace TemuKJD.KJDForms.ShopForms
case "素材库管理":
SetForm(materialManageForm.Value);
break;
+ case "超级用户管理":
+ SetForm(mainAccountForm.Value);
+ break;
}
}));
}).Start();
diff --git a/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs b/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs
index d7f998a..f9a5969 100644
--- a/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs
+++ b/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs
@@ -760,10 +760,26 @@ namespace TemuKJD.KJDForms.ShopForms
case "复制Cookies":
//SUB_PASS_ID=eyJ0IjoiRHBPWTBvVGxKWlZCZ1FmNVpPNGFwUjczdDZzUGk5bWVzbHZGejBUYlFkK3c4VjN4ZUIyV1RtZ24ybCtwWkhyNSIsInYiOjEsInMiOjEwMDAwLCJ1IjoyNDg3NDUxOTIxNzE0fQ==
string cook = shop.Cookies;
- cook = BaseRegex.GetStringCookie(ref cook, "SUB_PASS_ID");
- cook = "SUB_PASS_ID=" + cook;
- cook = "document.cookie='" + cook + "';window.location.href='https://seller.kuajingmaihuo.com'";
- Clipboard.SetDataObject(cook);
+ //cook = BaseRegex.GetStringCookie(ref cook, "SUB_PASS_ID");
+ //cook = "SUB_PASS_ID=" + cook;
+ //cook = "document.cookie='" + cook + "';window.location.href='https://seller.kuajingmaihuo.com'";
+ //Clipboard.SetDataObject(cook);
+
+ //var subPassId = cook = BaseRegex.GetStringCookie(ref cook, "SUB_PASS_ID");
+ //var nanoFp = cook = BaseRegex.GetStringCookie(ref cook, "_nano_fp");
+ //var cookJs = sJsSetCookie;
+ //cookJs += "\r\nsetCookie('SUB_PASS_ID', '" + subPassId + "', 'Session', '/', 'seller.kuajingmaihuo.com');";
+ //cookJs += "\r\nsetCookie('_nano_fp', '" + nanoFp + "', 1, '/', 'seller.kuajingmaihuo.com', true);";
+ //cookJs += "\r\nsetTimeout(() => { window.location.href='https://seller.kuajingmaihuo.com'; }, 200)";
+
+ string cookJs = "";
+ foreach(var cookie in shop.Cookies.Split(';'))
+ {
+ //if (!cookie.StartsWith("SUB_PASS_ID") && !cookie.StartsWith("_nano_fp"))
+ cookJs += "\r\ndocument.cookie='" + cookie.Trim() + "';";
+ }
+ cookJs += "\r\nsetTimeout(() => { window.location.href='https://seller.kuajingmaihuo.com'; }, 200)";
+ Clipboard.SetDataObject(cookJs);
BaseMsgForm.ShowInfo("复制成功");
break;
case "删除":
@@ -937,5 +953,41 @@ namespace TemuKJD.KJDForms.ShopForms
});
}
}
+
+ private static string sJsSetCookie = @"
+function setCookie(name, value, daysToLive, path, domain, secure, httpOnly, sameSite) {
+ //let cookie = name + '=' + encodeURIComponent(value) + ';';
+ let cookie = name + '=' + value + ';';
+ if (daysToLive) {
+ if (typeof daysToLive === 'string' && daysToLive.toLowerCase() == 'session') {
+ cookie += 'expires=Session;';
+ }
+ else {
+ let date = new Date();
+ date.setTime(date.getTime() + (daysToLive * 24 * 60 * 60 * 1000));
+ cookie += 'expires=' + date.toUTCString() + ';';
+ }
+ }
+ if (path) {
+ cookie += 'path=' + path + ';';
+ }
+ if (domain)
+ {
+ cookie += 'domain=' + domain + ';';
+ }
+ if (secure)
+ {
+ cookie += 'secure;';
+ }
+ if (httpOnly)
+ {
+ cookie += 'HttpOnly;';
+ }
+ if (sameSite)
+ {
+ cookie += 'SameSite=' + sameSite + ';';
+ }
+ document.cookie = cookie;
+}";
}
}
diff --git a/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.cs b/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.cs
index 89538bf..a4870d2 100644
--- a/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.cs
+++ b/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.cs
@@ -102,6 +102,8 @@ namespace TemuKJD.KJDForms.ShopForms
{
Thread.Sleep(3000);
//continue;
+ if (!this.Created)
+ break;
if (this.shop != null && currentUrl.TrimEnd('/') == shopMainUrl)
{
@@ -122,7 +124,7 @@ namespace TemuKJD.KJDForms.ShopForms
{
//SUB_PASS_ID同时出现两个,domain是seller.kuajingmaihuo.com才是能登录店铺后台的
if (cookie.Name == "SUB_PASS_ID" && cookie.Domain != "seller.kuajingmaihuo.com"
- && cookieList.Any(c=>c.Name== "SUB_PASS_ID" && cookie.Domain == "seller.kuajingmaihuo.com"))
+ && cookieList.Any(c=>c.Name== "SUB_PASS_ID" && c.Domain == "seller.kuajingmaihuo.com"))
continue;
cookies += cookie.Name + "=" + cookie.Value + "; ";
diff --git a/TEMUKJD/KJDForms/ShopForms/SubAccountListForm.Designer.cs b/TEMUKJD/KJDForms/ShopForms/SubAccountListForm.Designer.cs
index 39fb7c4..59ae1b4 100644
--- a/TEMUKJD/KJDForms/ShopForms/SubAccountListForm.Designer.cs
+++ b/TEMUKJD/KJDForms/ShopForms/SubAccountListForm.Designer.cs
@@ -28,9 +28,9 @@
///
private void InitializeComponent()
{
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer5 = new System.Windows.Forms.SplitContainer();
this.label1 = new System.Windows.Forms.Label();
this.btnRefresh = new TemuKJD.UserControls.ButtonEx();
@@ -38,15 +38,15 @@
this.btnOpUser = new TemuKJD.UserControls.ButtonEx();
this.label30 = new System.Windows.Forms.Label();
this.label31 = new System.Windows.Forms.Label();
- this.repasstextBox = new System.Windows.Forms.TextBox();
+ this.txtRePass = new System.Windows.Forms.TextBox();
this.label32 = new System.Windows.Forms.Label();
this.label33 = new System.Windows.Forms.Label();
this.label34 = new System.Windows.Forms.Label();
this.label35 = new System.Windows.Forms.Label();
this.label36 = new System.Windows.Forms.Label();
- this.groupIdcomboBox = new System.Windows.Forms.ComboBox();
+ this.cmbGroup = new System.Windows.Forms.ComboBox();
this.label37 = new System.Windows.Forms.Label();
- this.passwordtextBox = new System.Windows.Forms.TextBox();
+ this.txtPassword = new System.Windows.Forms.TextBox();
this.label38 = new System.Windows.Forms.Label();
this.mobiletextBox = new System.Windows.Forms.TextBox();
this.label39 = new System.Windows.Forms.Label();
@@ -84,15 +84,15 @@
this.splitContainer5.Panel1.Controls.Add(this.btnOpUser);
this.splitContainer5.Panel1.Controls.Add(this.label30);
this.splitContainer5.Panel1.Controls.Add(this.label31);
- this.splitContainer5.Panel1.Controls.Add(this.repasstextBox);
+ this.splitContainer5.Panel1.Controls.Add(this.txtRePass);
this.splitContainer5.Panel1.Controls.Add(this.label32);
this.splitContainer5.Panel1.Controls.Add(this.label33);
this.splitContainer5.Panel1.Controls.Add(this.label34);
this.splitContainer5.Panel1.Controls.Add(this.label35);
this.splitContainer5.Panel1.Controls.Add(this.label36);
- this.splitContainer5.Panel1.Controls.Add(this.groupIdcomboBox);
+ this.splitContainer5.Panel1.Controls.Add(this.cmbGroup);
this.splitContainer5.Panel1.Controls.Add(this.label37);
- this.splitContainer5.Panel1.Controls.Add(this.passwordtextBox);
+ this.splitContainer5.Panel1.Controls.Add(this.txtPassword);
this.splitContainer5.Panel1.Controls.Add(this.label38);
this.splitContainer5.Panel1.Controls.Add(this.mobiletextBox);
this.splitContainer5.Panel1.Controls.Add(this.label39);
@@ -187,11 +187,11 @@
//
// repasstextBox
//
- this.repasstextBox.Location = new System.Drawing.Point(112, 226);
- this.repasstextBox.Name = "repasstextBox";
- this.repasstextBox.PasswordChar = '*';
- this.repasstextBox.Size = new System.Drawing.Size(148, 23);
- this.repasstextBox.TabIndex = 24;
+ this.txtRePass.Location = new System.Drawing.Point(112, 226);
+ this.txtRePass.Name = "repasstextBox";
+ this.txtRePass.PasswordChar = '*';
+ this.txtRePass.Size = new System.Drawing.Size(148, 23);
+ this.txtRePass.TabIndex = 24;
//
// label32
//
@@ -245,19 +245,19 @@
//
// groupIdcomboBox
//
- this.groupIdcomboBox.Enabled = false;
- this.groupIdcomboBox.FormattingEnabled = true;
- this.groupIdcomboBox.Items.AddRange(new object[] {
+ this.cmbGroup.Enabled = false;
+ this.cmbGroup.FormattingEnabled = true;
+ this.cmbGroup.Items.AddRange(new object[] {
"客服",
"采购",
"上货",
"数据",
"登录"});
- this.groupIdcomboBox.Location = new System.Drawing.Point(112, 267);
- this.groupIdcomboBox.Name = "groupIdcomboBox";
- this.groupIdcomboBox.Size = new System.Drawing.Size(148, 25);
- this.groupIdcomboBox.TabIndex = 26;
- this.groupIdcomboBox.Text = "客服";
+ this.cmbGroup.Location = new System.Drawing.Point(112, 267);
+ this.cmbGroup.Name = "groupIdcomboBox";
+ this.cmbGroup.Size = new System.Drawing.Size(148, 25);
+ this.cmbGroup.TabIndex = 26;
+ this.cmbGroup.Text = "客服";
//
// label37
//
@@ -271,11 +271,11 @@
//
// passwordtextBox
//
- this.passwordtextBox.Location = new System.Drawing.Point(112, 184);
- this.passwordtextBox.Name = "passwordtextBox";
- this.passwordtextBox.PasswordChar = '*';
- this.passwordtextBox.Size = new System.Drawing.Size(148, 23);
- this.passwordtextBox.TabIndex = 23;
+ this.txtPassword.Location = new System.Drawing.Point(112, 184);
+ this.txtPassword.Name = "passwordtextBox";
+ this.txtPassword.PasswordChar = '*';
+ this.txtPassword.Size = new System.Drawing.Size(148, 23);
+ this.txtPassword.TabIndex = 23;
//
// label38
//
@@ -325,19 +325,19 @@
//
this.dgvUser.AllowUserToAddRows = false;
this.dgvUser.AllowUserToDeleteRows = false;
- dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
- this.dgvUser.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
+ dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
+ this.dgvUser.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4;
this.dgvUser.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvUser.BackgroundColor = System.Drawing.Color.White;
this.dgvUser.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
- dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
- this.dgvUser.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
+ dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
+ dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
+ dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+ dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+ dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+ this.dgvUser.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
this.dgvUser.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvUser.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.UserIdColumn,
@@ -348,14 +348,14 @@
this.shopCountColumn,
this.editColumn,
this.deleteColumn});
- dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
- dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;
- dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.ControlText;
- dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
- this.dgvUser.DefaultCellStyle = dataGridViewCellStyle3;
+ dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Window;
+ dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.ControlText;
+ dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+ dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.ControlText;
+ dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+ this.dgvUser.DefaultCellStyle = dataGridViewCellStyle6;
this.dgvUser.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvUser.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229)))));
this.dgvUser.Location = new System.Drawing.Point(0, 5);
@@ -448,15 +448,15 @@
private UserControls.ButtonEx btnOpUser;
private System.Windows.Forms.Label label30;
private System.Windows.Forms.Label label31;
- private System.Windows.Forms.TextBox repasstextBox;
+ private System.Windows.Forms.TextBox txtRePass;
private System.Windows.Forms.Label label32;
private System.Windows.Forms.Label label33;
private System.Windows.Forms.Label label34;
private System.Windows.Forms.Label label35;
private System.Windows.Forms.Label label36;
- private System.Windows.Forms.ComboBox groupIdcomboBox;
+ private System.Windows.Forms.ComboBox cmbGroup;
private System.Windows.Forms.Label label37;
- private System.Windows.Forms.TextBox passwordtextBox;
+ private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.Label label38;
private System.Windows.Forms.TextBox mobiletextBox;
private System.Windows.Forms.Label label39;
diff --git a/TEMUKJD/KJDForms/ShopForms/SubAccountListForm.cs b/TEMUKJD/KJDForms/ShopForms/SubAccountListForm.cs
index fea5a09..fb8bdf2 100644
--- a/TEMUKJD/KJDForms/ShopForms/SubAccountListForm.cs
+++ b/TEMUKJD/KJDForms/ShopForms/SubAccountListForm.cs
@@ -25,12 +25,12 @@ namespace TemuKJD.KJDForms.ShopForms
}
private void btnOpUser_Click(object sender, EventArgs e)
{
- if (passwordtextBox.Text != repasstextBox.Text)
+ if (txtPassword.Text != txtRePass.Text)
{
BaseMsgForm.ShowInfo("两次密码不正确", "提示");
return;
}
- if (btnOpUser.Text == "添加用户" && passwordtextBox.Text.Length < 6)
+ if (btnOpUser.Text == "添加用户" && txtPassword.Text.Length < 6)
{
BaseMsgForm.ShowInfo("密码最少6位", "提示");
return;
@@ -48,23 +48,23 @@ namespace TemuKJD.KJDForms.ShopForms
data.Append("&sub_name=" + GetHtml.UrlEncodeUtf8(mobiletextBox.Text));
data.Append("&sub_mobile=" + GetHtml.UrlEncodeUtf8(mobiletextBox.Text));
data.Append("&card_id=");
- if (groupIdcomboBox.Text == "客服")
+ if (cmbGroup.Text == "客服")
data.Append("&group_id=4");
- else if (groupIdcomboBox.Text == "采购")
- data.Append("&group_id=9");
else
{
BaseMsgForm.ShowInfo("分组不正确", "提示");
return;
}
+ //else if (groupIdcomboBox.Text == "采购")
+ // data.Append("&group_id=9");
//if (groupIdcomboBox.Text == "上货")
// data.Append("&group_id=10");
//if (groupIdcomboBox.Text == "数据")
// data.Append("&group_id=11");
//if (groupIdcomboBox.Text == "登录")
// data.Append("&group_id=8");
- if (!string.IsNullOrEmpty(passwordtextBox.Text))
- data.Append("&sub_password=" + Md5Base.GetMd5(passwordtextBox.Text).ToLower());
+ if (!string.IsNullOrEmpty(txtPassword.Text))
+ data.Append("&sub_password=" + Md5Base.GetMd5(txtPassword.Text).ToLower());
string url = BaseClass.BuildObjString("user/add_sub_user");
if (btnOpUser.Text != "添加用户" && !string.IsNullOrEmpty(Uid))
{
@@ -100,8 +100,8 @@ namespace TemuKJD.KJDForms.ShopForms
private void EmptyInput()
{
txtNickName.Clear();
- passwordtextBox.Clear();
- repasstextBox.Clear();
+ txtPassword.Clear();
+ txtRePass.Clear();
mobiletextBox.Clear();
}
@@ -156,9 +156,9 @@ namespace TemuKJD.KJDForms.ShopForms
Uid = uid;
txtNickName.Text = nickName;
mobiletextBox.Text = mobile;
- groupIdcomboBox.Text = groupName;
- passwordtextBox.Text = "";
- repasstextBox.Text = "";
+ cmbGroup.Text = groupName;
+ txtPassword.Text = "";
+ txtRePass.Text = "";
btnOpUser.Text = "保存用户";
btnCancel.Visible = true;
}
@@ -182,7 +182,7 @@ namespace TemuKJD.KJDForms.ShopForms
{
if (html.Contains("\"code\":200"))
{
- BaseMsgForm.ShowInfo("提交成功", "提示");
+ BaseMsgForm.ShowInfo("删除成功", "提示");
GetUser();
return;
}
@@ -197,11 +197,11 @@ namespace TemuKJD.KJDForms.ShopForms
private void SubAccountForm_Load(object sender, EventArgs e)
{
- this.groupIdcomboBox.Enabled = false;
- this.groupIdcomboBox.Items.Clear();
+ this.cmbGroup.Enabled = false;
+ this.cmbGroup.Items.Clear();
//this.groupIdcomboBox.Items.Add("上货");
//this.groupIdcomboBox.Items.Add("采购");
- this.groupIdcomboBox.Items.Add("客服");
+ this.cmbGroup.Items.Add("客服");
//if (BaseClass.UserName == "18888888888")
//{
// this.groupIdcomboBox.Items.Add("主管");
diff --git a/TEMUKJD/KJDForms/SystemForms/SystemRemoveRestrictionsForm.Designer.cs b/TEMUKJD/KJDForms/SystemForms/SystemRemoveRestrictionsForm.Designer.cs
index c11f436..c475d75 100644
--- a/TEMUKJD/KJDForms/SystemForms/SystemRemoveRestrictionsForm.Designer.cs
+++ b/TEMUKJD/KJDForms/SystemForms/SystemRemoveRestrictionsForm.Designer.cs
@@ -62,7 +62,7 @@
this.label6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(153)))), ((int)(((byte)(153)))));
this.label6.Location = new System.Drawing.Point(201, 287);
this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(52, 16);
+ this.label6.Size = new System.Drawing.Size(51, 16);
this.label6.TabIndex = 126;
this.label6.Text = "设置代理";
this.label6.Visible = false;
@@ -90,7 +90,7 @@
this.label5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(153)))), ((int)(((byte)(153)))));
this.label5.Location = new System.Drawing.Point(405, 287);
this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(52, 16);
+ this.label5.Size = new System.Drawing.Size(51, 16);
this.label5.TabIndex = 123;
this.label5.Text = "进入管理";
this.label5.Visible = false;
@@ -104,7 +104,7 @@
this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(153)))), ((int)(((byte)(153)))));
this.label4.Location = new System.Drawing.Point(592, 287);
this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(52, 16);
+ this.label4.Size = new System.Drawing.Size(51, 16);
this.label4.TabIndex = 122;
this.label4.Text = "设置拨号";
this.label4.Visible = false;
@@ -118,7 +118,7 @@
this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(153)))), ((int)(((byte)(153)))));
this.label3.Location = new System.Drawing.Point(592, 143);
this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(52, 16);
+ this.label3.Size = new System.Drawing.Size(51, 16);
this.label3.TabIndex = 121;
this.label3.Text = "点击登录";
this.label3.Visible = false;
@@ -131,7 +131,7 @@
this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(153)))), ((int)(((byte)(153)))));
this.label2.Location = new System.Drawing.Point(405, 143);
this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(52, 16);
+ this.label2.Size = new System.Drawing.Size(51, 16);
this.label2.TabIndex = 120;
this.label2.Text = "点击登录";
this.label2.Visible = false;
@@ -145,7 +145,7 @@
this.label13.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(153)))), ((int)(((byte)(153)))));
this.label13.Location = new System.Drawing.Point(201, 143);
this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(52, 16);
+ this.label13.Size = new System.Drawing.Size(51, 16);
this.label13.TabIndex = 119;
this.label13.Text = "点击登录";
this.label13.Visible = false;
diff --git a/TEMUKJD/StartUp.cs b/TEMUKJD/StartUp.cs
index 58da27b..eb7c501 100644
--- a/TEMUKJD/StartUp.cs
+++ b/TEMUKJD/StartUp.cs
@@ -63,8 +63,9 @@ namespace TemuKJD
#region 店铺登录信息
Task.Run((Action)(() =>
{
- while (string.IsNullOrEmpty(BaseClass.CompanyName))
- Thread.Sleep(100);
+ //while (string.IsNullOrEmpty(BaseClass.CompanyName))
+ while (!BaseClass.IsLoginSuccess)
+ Thread.Sleep(100);
// 获取本地店铺和服务端店铺。将服务端相关信息与本地店铺合并后暂时存在内存中(不保存敏感信息)。
GlobalConfig.ShopLoginList = new ConcurrentList();