超级用户管理功能
This commit is contained in:
1 parent
2b21ecf62a
commit
0646f19990
13 files changed
+610
-333
No files matched your search
@@ -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<DouShopSubAccountInfo> AllUsers { get; set; } = new List<DouShopSubAccountInfo>();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
+218
-92
@@ -1,7 +1,7 @@
|
||||
|
||||
namespace TemuKJD.KJDForms.AccountForms
|
||||
{
|
||||
partial class AccountForm
|
||||
partial class MainAccountForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
@@ -29,36 +29,45 @@ namespace TemuKJD.KJDForms.AccountForms
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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<DouShopSubAccountInfo> AllUsers { get; set; } = new List<DouShopSubAccountInfo>();
|
||||
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("全部");
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -132,6 +132,9 @@
|
||||
<metadata name="groupNameColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colCompany.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="shopCountColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
Reference in new issue
Block a user