From 45654ccd17cc2a95d69bfcae1e40d410e412bb17 Mon Sep 17 00:00:00 2001 From: lg <999544862qq.com> Date: 星期四, 29 八月 2024 16:24:54 +0800 Subject: [PATCH] 用户管理 --- DevApp/Gs.DevApp/DevFrm/User/UserAdd.resx | 120 +++++ DevApp/Gs.DevApp/DevFrm/User/Organization.Designer.cs | 306 +++++++----- DevApp/Gs.DevApp/DevFrm/User/UserAdd.Designer.cs | 376 +++++++++++++++ DevApp/Gs.DevApp/DevFrm/User/User.Designer.cs | 208 ++++++++ DevApp/Gs.DevApp/DevFrm/User/UserAdd.cs | 87 +++ DevApp/Gs.DevApp/DevFrm/User/Organization.cs | 109 ++++ DevApp/Gs.DevApp/DevFrm/User/SysMenu.cs | 1 DevApp/Gs.DevApp/DevFrm/User/User.cs | 73 +++ DevApp/Gs.DevApp/DevFrm/User/SysMenu.Designer.cs | 3 DevApp/Gs.DevApp/DevFrm/User/User.resx | 120 +++++ 10 files changed, 1,268 insertions(+), 135 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/User/Organization.Designer.cs b/DevApp/Gs.DevApp/DevFrm/User/Organization.Designer.cs index 62d73a3..fb9c6c6 100644 --- a/DevApp/Gs.DevApp/DevFrm/User/Organization.Designer.cs +++ b/DevApp/Gs.DevApp/DevFrm/User/Organization.Designer.cs @@ -29,39 +29,35 @@ /// </summary> private void InitializeComponent() { - System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("鍒嗗叕鍙�1"); - System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("鍒嗗叕鍙�2"); - System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("鍒嗗叕鍙�3"); - System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("鍒嗗叕鍙�4"); - System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("鏌愭煇鏈夐檺鍏徃", new System.Windows.Forms.TreeNode[] { - treeNode1, - treeNode2, - treeNode3, - treeNode4}); this.toolBarMenu1 = new Gs.DevApp.UserControl.ToolBarMenu(); - this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.panel1 = new System.Windows.Forms.Panel(); - this.textEdit4 = new DevExpress.XtraEditors.TextEdit(); - this.labelControl4 = new DevExpress.XtraEditors.LabelControl(); - this.textEdit3 = new DevExpress.XtraEditors.TextEdit(); - this.labelControl3 = new DevExpress.XtraEditors.LabelControl(); - this.textEdit2 = new DevExpress.XtraEditors.TextEdit(); - this.labelControl2 = new DevExpress.XtraEditors.LabelControl(); - this.textEdit1 = new DevExpress.XtraEditors.TextEdit(); + this.labelControl8 = new DevExpress.XtraEditors.LabelControl(); + this.comUp = new System.Windows.Forms.ComboBox(); + this.labelControl6 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl7 = new DevExpress.XtraEditors.LabelControl(); + this.txtStatus = new DevExpress.XtraEditors.ComboBoxEdit(); + this.lbGuid = new System.Windows.Forms.Label(); + this.labelControl5 = new DevExpress.XtraEditors.LabelControl(); this.labelControl1 = new DevExpress.XtraEditors.LabelControl(); - this.treeView1 = new System.Windows.Forms.TreeView(); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.label1 = new System.Windows.Forms.Label(); - this.tabControl1.SuspendLayout(); + this.labelControl12 = new DevExpress.XtraEditors.LabelControl(); + this.txtConTel = new DevExpress.XtraEditors.TextEdit(); + this.labelControl4 = new DevExpress.XtraEditors.LabelControl(); + this.txtConPeople = new DevExpress.XtraEditors.TextEdit(); + this.labelControl3 = new DevExpress.XtraEditors.LabelControl(); + this.txtName = new DevExpress.XtraEditors.TextEdit(); + this.labelControl2 = new DevExpress.XtraEditors.LabelControl(); + this.trv = new System.Windows.Forms.TreeView(); + this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.textEdit4.Properties)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.textEdit3.Properties)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.textEdit2.Properties)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtStatus.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtConTel.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtConPeople.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtName.Properties)).BeginInit(); + this.tabControl1.SuspendLayout(); this.SuspendLayout(); // // toolBarMenu1 @@ -72,21 +68,10 @@ this.toolBarMenu1.Size = new System.Drawing.Size(917, 80); this.toolBarMenu1.TabIndex = 0; // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Controls.Add(this.tabPage2); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.Location = new System.Drawing.Point(0, 80); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(917, 564); - this.tabControl1.TabIndex = 2; - // // tabPage1 // this.tabPage1.Controls.Add(this.groupBox1); - this.tabPage1.Controls.Add(this.treeView1); + this.tabPage1.Controls.Add(this.trv); this.tabPage1.Location = new System.Drawing.Point(4, 27); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); @@ -97,7 +82,6 @@ // // groupBox1 // - this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.panel1); this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox1.Location = new System.Drawing.Point(210, 3); @@ -109,25 +93,122 @@ // // panel1 // - this.panel1.Controls.Add(this.textEdit4); - this.panel1.Controls.Add(this.labelControl4); - this.panel1.Controls.Add(this.textEdit3); - this.panel1.Controls.Add(this.labelControl3); - this.panel1.Controls.Add(this.textEdit2); - this.panel1.Controls.Add(this.labelControl2); - this.panel1.Controls.Add(this.textEdit1); + this.panel1.Controls.Add(this.labelControl8); + this.panel1.Controls.Add(this.comUp); + this.panel1.Controls.Add(this.labelControl6); + this.panel1.Controls.Add(this.labelControl7); + this.panel1.Controls.Add(this.txtStatus); + this.panel1.Controls.Add(this.lbGuid); + this.panel1.Controls.Add(this.labelControl5); this.panel1.Controls.Add(this.labelControl1); - this.panel1.Location = new System.Drawing.Point(28, 25); + this.panel1.Controls.Add(this.labelControl12); + this.panel1.Controls.Add(this.txtConTel); + this.panel1.Controls.Add(this.labelControl4); + this.panel1.Controls.Add(this.txtConPeople); + this.panel1.Controls.Add(this.labelControl3); + this.panel1.Controls.Add(this.txtName); + this.panel1.Controls.Add(this.labelControl2); + this.panel1.Location = new System.Drawing.Point(28, 45); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(462, 307); this.panel1.TabIndex = 0; // - // textEdit4 + // labelControl8 // - this.textEdit4.Location = new System.Drawing.Point(133, 168); - this.textEdit4.Name = "textEdit4"; - this.textEdit4.Size = new System.Drawing.Size(125, 24); - this.textEdit4.TabIndex = 7; + this.labelControl8.Location = new System.Drawing.Point(295, 35); + this.labelControl8.Name = "labelControl8"; + this.labelControl8.Size = new System.Drawing.Size(120, 18); + this.labelControl8.TabIndex = 120; + this.labelControl8.Text = "锛堢┖灏嗕负鏍圭粍缁囷級"; + // + // comUp + // + this.comUp.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comUp.FormattingEnabled = true; + this.comUp.Location = new System.Drawing.Point(133, 32); + this.comUp.Name = "comUp"; + this.comUp.Size = new System.Drawing.Size(156, 26); + this.comUp.TabIndex = 119; + // + // labelControl6 + // + this.labelControl6.Location = new System.Drawing.Point(41, 38); + this.labelControl6.Name = "labelControl6"; + this.labelControl6.Size = new System.Drawing.Size(75, 18); + this.labelControl6.TabIndex = 118; + this.labelControl6.Text = "涓婄骇缁勭粐锛�"; + // + // labelControl7 + // + this.labelControl7.Location = new System.Drawing.Point(41, 216); + this.labelControl7.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl7.Name = "labelControl7"; + this.labelControl7.Size = new System.Drawing.Size(75, 18); + this.labelControl7.TabIndex = 117; + this.labelControl7.Text = "缁勭粐鐘舵�侊細"; + // + // txtStatus + // + this.txtStatus.Location = new System.Drawing.Point(133, 213); + this.txtStatus.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.txtStatus.Name = "txtStatus"; + this.txtStatus.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { + new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); + this.txtStatus.Properties.Items.AddRange(new object[] { + "-璇烽�夋嫨-", + "姝e父", + "绂佺敤"}); + this.txtStatus.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; + this.txtStatus.Size = new System.Drawing.Size(156, 24); + this.txtStatus.TabIndex = 116; + // + // lbGuid + // + this.lbGuid.AutoSize = true; + this.lbGuid.Location = new System.Drawing.Point(41, 250); + this.lbGuid.Name = "lbGuid"; + this.lbGuid.Size = new System.Drawing.Size(0, 18); + this.lbGuid.TabIndex = 111; + // + // labelControl5 + // + this.labelControl5.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl5.Appearance.Options.UseForeColor = true; + this.labelControl5.Location = new System.Drawing.Point(296, 174); + this.labelControl5.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl5.Name = "labelControl5"; + this.labelControl5.Size = new System.Drawing.Size(8, 18); + this.labelControl5.TabIndex = 110; + this.labelControl5.Text = "*"; + // + // labelControl1 + // + this.labelControl1.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl1.Appearance.Options.UseForeColor = true; + this.labelControl1.Location = new System.Drawing.Point(296, 125); + this.labelControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl1.Name = "labelControl1"; + this.labelControl1.Size = new System.Drawing.Size(8, 18); + this.labelControl1.TabIndex = 109; + this.labelControl1.Text = "*"; + // + // labelControl12 + // + this.labelControl12.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl12.Appearance.Options.UseForeColor = true; + this.labelControl12.Location = new System.Drawing.Point(296, 77); + this.labelControl12.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl12.Name = "labelControl12"; + this.labelControl12.Size = new System.Drawing.Size(8, 18); + this.labelControl12.TabIndex = 108; + this.labelControl12.Text = "*"; + // + // txtConTel + // + this.txtConTel.Location = new System.Drawing.Point(133, 168); + this.txtConTel.Name = "txtConTel"; + this.txtConTel.Size = new System.Drawing.Size(156, 24); + this.txtConTel.TabIndex = 7; // // labelControl4 // @@ -137,12 +218,12 @@ this.labelControl4.TabIndex = 6; this.labelControl4.Text = "璐熻矗浜虹數璇濓細"; // - // textEdit3 + // txtConPeople // - this.textEdit3.Location = new System.Drawing.Point(133, 119); - this.textEdit3.Name = "textEdit3"; - this.textEdit3.Size = new System.Drawing.Size(125, 24); - this.textEdit3.TabIndex = 5; + this.txtConPeople.Location = new System.Drawing.Point(133, 119); + this.txtConPeople.Name = "txtConPeople"; + this.txtConPeople.Size = new System.Drawing.Size(156, 24); + this.txtConPeople.TabIndex = 5; // // labelControl3 // @@ -152,12 +233,12 @@ this.labelControl3.TabIndex = 4; this.labelControl3.Text = "缁勭粐璐熻矗浜猴細"; // - // textEdit2 + // txtName // - this.textEdit2.Location = new System.Drawing.Point(133, 74); - this.textEdit2.Name = "textEdit2"; - this.textEdit2.Size = new System.Drawing.Size(125, 24); - this.textEdit2.TabIndex = 3; + this.txtName.Location = new System.Drawing.Point(133, 74); + this.txtName.Name = "txtName"; + this.txtName.Size = new System.Drawing.Size(156, 24); + this.txtName.TabIndex = 3; // // labelControl2 // @@ -167,59 +248,24 @@ this.labelControl2.TabIndex = 2; this.labelControl2.Text = "缁勭粐鍚嶇О锛�"; // - // textEdit1 + // trv // - this.textEdit1.Location = new System.Drawing.Point(133, 26); - this.textEdit1.Name = "textEdit1"; - this.textEdit1.Size = new System.Drawing.Size(125, 24); - this.textEdit1.TabIndex = 1; + this.trv.Dock = System.Windows.Forms.DockStyle.Left; + this.trv.Font = new System.Drawing.Font("Tahoma", 10F); + this.trv.Location = new System.Drawing.Point(3, 3); + this.trv.Name = "trv"; + this.trv.Size = new System.Drawing.Size(207, 527); + this.trv.TabIndex = 1; // - // labelControl1 + // tabControl1 // - this.labelControl1.Location = new System.Drawing.Point(41, 32); - this.labelControl1.Name = "labelControl1"; - this.labelControl1.Size = new System.Drawing.Size(75, 18); - this.labelControl1.TabIndex = 0; - this.labelControl1.Text = "缁勭粐缂栧彿锛�"; - // - // treeView1 - // - this.treeView1.Dock = System.Windows.Forms.DockStyle.Left; - this.treeView1.Location = new System.Drawing.Point(3, 3); - this.treeView1.Name = "treeView1"; - treeNode1.Name = "鑺傜偣1"; - treeNode1.Text = "鍒嗗叕鍙�1"; - treeNode2.Name = "鑺傜偣2"; - treeNode2.Text = "鍒嗗叕鍙�2"; - treeNode3.Name = "鑺傜偣3"; - treeNode3.Text = "鍒嗗叕鍙�3"; - treeNode4.Name = "鑺傜偣4"; - treeNode4.Text = "鍒嗗叕鍙�4"; - treeNode5.Name = "鑺傜偣0"; - treeNode5.Text = "鏌愭煇鏈夐檺鍏徃"; - this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { - treeNode5}); - this.treeView1.Size = new System.Drawing.Size(207, 527); - this.treeView1.TabIndex = 1; - // - // tabPage2 - // - this.tabPage2.Location = new System.Drawing.Point(4, 27); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(909, 533); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "鏁版嵁缂栬緫"; - this.tabPage2.UseVisualStyleBackColor = true; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(93, 401); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(44, 18); - this.label1.TabIndex = 1; - this.label1.Text = "label1"; + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 80); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(917, 564); + this.tabControl1.TabIndex = 2; // // Organization // @@ -230,16 +276,15 @@ this.Controls.Add(this.toolBarMenu1); this.Name = "Organization"; this.Text = "Organization"; - this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.textEdit4.Properties)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.textEdit3.Properties)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.textEdit2.Properties)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtStatus.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtConTel.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtConPeople.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtName.Properties)).EndInit(); + this.tabControl1.ResumeLayout(false); this.ResumeLayout(false); } @@ -247,20 +292,25 @@ #endregion private UserControl.ToolBarMenu toolBarMenu1; - private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Panel panel1; - private DevExpress.XtraEditors.TextEdit textEdit4; - private DevExpress.XtraEditors.LabelControl labelControl4; - private DevExpress.XtraEditors.TextEdit textEdit3; - private DevExpress.XtraEditors.LabelControl labelControl3; - private DevExpress.XtraEditors.TextEdit textEdit2; - private DevExpress.XtraEditors.LabelControl labelControl2; - private DevExpress.XtraEditors.TextEdit textEdit1; + private DevExpress.XtraEditors.LabelControl labelControl8; + private System.Windows.Forms.ComboBox comUp; + private DevExpress.XtraEditors.LabelControl labelControl6; + private DevExpress.XtraEditors.LabelControl labelControl7; + private DevExpress.XtraEditors.ComboBoxEdit txtStatus; + private System.Windows.Forms.Label lbGuid; + private DevExpress.XtraEditors.LabelControl labelControl5; private DevExpress.XtraEditors.LabelControl labelControl1; - private System.Windows.Forms.TreeView treeView1; - private System.Windows.Forms.TabPage tabPage2; - private System.Windows.Forms.Label label1; + private DevExpress.XtraEditors.LabelControl labelControl12; + private DevExpress.XtraEditors.TextEdit txtConTel; + private DevExpress.XtraEditors.LabelControl labelControl4; + private DevExpress.XtraEditors.TextEdit txtConPeople; + private DevExpress.XtraEditors.LabelControl labelControl3; + private DevExpress.XtraEditors.TextEdit txtName; + private DevExpress.XtraEditors.LabelControl labelControl2; + private System.Windows.Forms.TreeView trv; + private System.Windows.Forms.TabControl tabControl1; } } \ No newline at end of file diff --git a/DevApp/Gs.DevApp/DevFrm/User/Organization.cs b/DevApp/Gs.DevApp/DevFrm/User/Organization.cs index 8eaa64b..cd71832 100644 --- a/DevApp/Gs.DevApp/DevFrm/User/Organization.cs +++ b/DevApp/Gs.DevApp/DevFrm/User/Organization.cs @@ -1,11 +1,11 @@ 锘縰sing DevExpress.XtraEditors; +using Gs.DevApp.Models; +using Gs.DevApp.ToolBox; +using Newtonsoft.Json; 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; @@ -16,11 +16,106 @@ public Organization() { InitializeComponent(); - ImageList imageList = new ImageList(); - imageList.Images.Add("icon1", Properties.Resources.usergroup_32x32); - imageList.Images.Add("icon2", Properties.Resources.user_16x16); - treeView1.ImageList = imageList; + this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; + getTree(); + UtilityHelper.SetFont(panel1); + } + private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(txtName.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("鍚嶇О涓嶈兘涓虹┖锛�"); + txtName.Focus(); + return; + } + if (string.IsNullOrEmpty(txtConPeople.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("鑱旂郴浜轰笉鑳戒负绌猴紒"); + txtConPeople.Focus(); + return; + } + if (string.IsNullOrEmpty(txtConPeople.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("鑱旂郴鐢佃瘽涓嶈兘涓虹┖锛�"); + txtConPeople.Focus(); + return; + } + if (string.IsNullOrEmpty(txtConTel.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("鐘舵�佷笉鑳戒负绌猴紒"); + txtConTel.Focus(); + return; + } + string _upGuid = comUp.SelectedValue.ToString(); + var _obj = new + { + guid = lbGuid.Text.Trim(),//涓诲缓 + upGuid = _upGuid,//涓婄骇鐨勪富寤� + name = txtName.Text.Trim(),//鍚嶇О + conPeople = txtConPeople.Text,//鑱旂郴浜� + conTel = txtConPeople.Text,//鑱旂郴鐢佃瘽 + status = txtStatus.SelectedIndex,//鐘舵�� + }; + string strJson = ""; + try + { + strJson = UtilityHelper.HttpPost("", "Organization/EditModel", JsonConvert.SerializeObject(_obj)); + ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.GetDataByJson(strJson); + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + if (_rtn.rtnCode > 0) { getTree(); } + } + catch (Exception ex) + { + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + } + private void getTree() + { + trv.Nodes.Clear(); + ImageList imageList = new ImageList(); + imageList.Images.Add("icon1", Properties.Resources.publicfix_32x32); + imageList.Images.Add("icon2", Properties.Resources.user_16x16); + trv.ImageList = imageList; + Models.PageQueryModel pgq = new Models.PageQueryModel(1, 999999, "name", "desc", "", ""); + string json = JsonConvert.SerializeObject(pgq); + string strReturn = ""; + try + { + strReturn = UtilityHelper.HttpPost("", "Organization/GetListPage", json); + ReturnModel<PageListModel> dd = UtilityHelper.GetTableByJson(strReturn); + DataTable dt = dd.rtnData.list; + DataRow[] drGrp = dt.Select("upGuid=''"); + DataTable dtComList = new DataTable(); + dtComList.Columns.Add("guid", typeof(string)); + dtComList.Columns.Add("name", typeof(string)); + foreach (DataRow _dy in drGrp) + { + dtComList.Rows.Add(_dy["guid"].ToString(), _dy["name"].ToString()); + TreeNode node = new TreeNode();//瀹氫箟缁撶偣 + node.Text = _dy["name"].ToString();//涓虹粨鐐硅祴鍊� + node.Name = _dy["guid"].ToString(); + node.ImageIndex =0; + DataRow[] drItem = dt.Select("upGuid='" + _dy["guid"].ToString() + "'"); + foreach (DataRow _dy2 in drItem) + { + TreeNode node22 = new TreeNode();//瀹氫箟缁撶偣 + node22.Text = _dy2["name"].ToString();//涓虹粨鐐硅祴鍊� + node22.Name = _dy2["guid"].ToString(); + node22.ImageIndex = 1; + node.Nodes.Add(node22); + } + node.ExpandAll(); + trv.Nodes.Add(node); + } + comUp.DataSource = dtComList; + comUp.DisplayMember = "name"; + comUp.ValueMember = "guid"; + } + catch (Exception ex) + { + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } } } } \ No newline at end of file diff --git a/DevApp/Gs.DevApp/DevFrm/User/SysMenu.Designer.cs b/DevApp/Gs.DevApp/DevFrm/User/SysMenu.Designer.cs index a7e6121..d11c316 100644 --- a/DevApp/Gs.DevApp/DevFrm/User/SysMenu.Designer.cs +++ b/DevApp/Gs.DevApp/DevFrm/User/SysMenu.Designer.cs @@ -79,6 +79,8 @@ // // tlMenu // + this.tlMenu.Appearance.Row.Font = new System.Drawing.Font("Tahoma", 10F); + this.tlMenu.Appearance.Row.Options.UseFont = true; this.tlMenu.Columns.AddRange(new DevExpress.XtraTreeList.Columns.TreeListColumn[] { this.tlcModuleID, this.tlcMenuName, @@ -89,6 +91,7 @@ this.treeListColumn1}); this.tlMenu.Cursor = System.Windows.Forms.Cursors.Default; this.tlMenu.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlMenu.Font = new System.Drawing.Font("Tahoma", 9F); this.tlMenu.Location = new System.Drawing.Point(3, 3); this.tlMenu.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.tlMenu.MinWidth = 23; diff --git a/DevApp/Gs.DevApp/DevFrm/User/SysMenu.cs b/DevApp/Gs.DevApp/DevFrm/User/SysMenu.cs index 389b11e..e170d3a 100644 --- a/DevApp/Gs.DevApp/DevFrm/User/SysMenu.cs +++ b/DevApp/Gs.DevApp/DevFrm/User/SysMenu.cs @@ -17,6 +17,7 @@ this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick; this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; + } private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e) diff --git a/DevApp/Gs.DevApp/DevFrm/User/User.Designer.cs b/DevApp/Gs.DevApp/DevFrm/User/User.Designer.cs new file mode 100644 index 0000000..d840053 --- /dev/null +++ b/DevApp/Gs.DevApp/DevFrm/User/User.Designer.cs @@ -0,0 +1,208 @@ +锘� +namespace Gs.DevApp.DevFrm.User +{ + partial class User + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.toolBarMenu1 = new Gs.DevApp.UserControl.ToolBarMenu(); + this.gc_Main = new DevExpress.XtraGrid.GridControl(); + this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + this.account = new DevExpress.XtraGrid.Columns.GridColumn(); + this.userName = new DevExpress.XtraGrid.Columns.GridColumn(); + this.tel = new DevExpress.XtraGrid.Columns.GridColumn(); + this.email = new DevExpress.XtraGrid.Columns.GridColumn(); + this.createTime = new DevExpress.XtraGrid.Columns.GridColumn(); + this.lastLoginTime = new DevExpress.XtraGrid.Columns.GridColumn(); + this.isLocked = new DevExpress.XtraGrid.Columns.GridColumn(); + this.loginCounter = new DevExpress.XtraGrid.Columns.GridColumn(); + this.PageBar1 = new UserControls.Data.PageBar(); + ((System.ComponentModel.ISupportInitialize)(this.gc_Main)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit(); + this.SuspendLayout(); + // + // toolBarMenu1 + // + this.toolBarMenu1.Dock = System.Windows.Forms.DockStyle.Top; + this.toolBarMenu1.Location = new System.Drawing.Point(0, 0); + this.toolBarMenu1.Name = "toolBarMenu1"; + this.toolBarMenu1.Size = new System.Drawing.Size(1128, 91); + this.toolBarMenu1.TabIndex = 0; + // + // gc_Main + // + this.gc_Main.Dock = System.Windows.Forms.DockStyle.Fill; + this.gc_Main.Font = new System.Drawing.Font("Tahoma", 10F); + this.gc_Main.Location = new System.Drawing.Point(0, 91); + this.gc_Main.MainView = this.gridView1; + this.gc_Main.Name = "gc_Main"; + this.gc_Main.Size = new System.Drawing.Size(1128, 361); + this.gc_Main.TabIndex = 1; + this.gc_Main.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { + this.gridView1}); + // + // gridView1 + // + this.gridView1.Appearance.Row.Font = new System.Drawing.Font("Tahoma", 10F); + this.gridView1.Appearance.Row.Options.UseFont = true; + this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { + this.account, + this.userName, + this.tel, + this.email, + this.createTime, + this.lastLoginTime, + this.isLocked, + this.loginCounter}); + this.gridView1.GridControl = this.gc_Main; + this.gridView1.Name = "gridView1"; + // + // account + // + this.account.Caption = "鐧诲綍璐﹀彿"; + this.account.FieldName = "account"; + this.account.MinWidth = 25; + this.account.Name = "account"; + this.account.Visible = true; + this.account.VisibleIndex = 0; + this.account.Width = 94; + // + // userName + // + this.userName.Caption = "鐢ㄦ埛鍚�"; + this.userName.FieldName = "userName"; + this.userName.MinWidth = 25; + this.userName.Name = "userName"; + this.userName.Visible = true; + this.userName.VisibleIndex = 1; + this.userName.Width = 94; + // + // tel + // + this.tel.Caption = "鑱旂郴鐢佃瘽"; + this.tel.FieldName = "tel"; + this.tel.MinWidth = 25; + this.tel.Name = "tel"; + this.tel.Visible = true; + this.tel.VisibleIndex = 2; + this.tel.Width = 94; + // + // email + // + this.email.Caption = "閭"; + this.email.FieldName = "email"; + this.email.MinWidth = 25; + this.email.Name = "email"; + this.email.Visible = true; + this.email.VisibleIndex = 3; + this.email.Width = 94; + // + // createTime + // + this.createTime.Caption = "寤虹珛鏃堕棿"; + this.createTime.FieldName = "createTime"; + this.createTime.MinWidth = 25; + this.createTime.Name = "createTime"; + this.createTime.Visible = true; + this.createTime.VisibleIndex = 4; + this.createTime.Width = 94; + // + // lastLoginTime + // + this.lastLoginTime.Caption = "鏈�杩戠櫥褰曟椂闂�"; + this.lastLoginTime.FieldName = "lastLoginTime"; + this.lastLoginTime.MinWidth = 25; + this.lastLoginTime.Name = "lastLoginTime"; + this.lastLoginTime.Visible = true; + this.lastLoginTime.VisibleIndex = 5; + this.lastLoginTime.Width = 94; + // + // isLocked + // + this.isLocked.Caption = "鐘舵��"; + this.isLocked.FieldName = "isLocked"; + this.isLocked.MinWidth = 25; + this.isLocked.Name = "isLocked"; + this.isLocked.Visible = true; + this.isLocked.VisibleIndex = 6; + this.isLocked.Width = 94; + // + // loginCounter + // + this.loginCounter.Caption = "鐧诲綍娆℃暟"; + this.loginCounter.FieldName = "loginCounter"; + this.loginCounter.MinWidth = 25; + this.loginCounter.Name = "loginCounter"; + this.loginCounter.Visible = true; + this.loginCounter.VisibleIndex = 7; + this.loginCounter.Width = 94; + // + // PageBar1 + // + this.PageBar1.CurrentPage = 1; + this.PageBar1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.PageBar1.Location = new System.Drawing.Point(0, 452); + this.PageBar1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.PageBar1.Name = "PageBar1"; + this.PageBar1.RecordCount = 0; + this.PageBar1.RowsCount = 50; + this.PageBar1.Size = new System.Drawing.Size(1128, 63); + this.PageBar1.TabIndex = 2; + this.PageBar1.TotalPages = 0; + // + // User + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1128, 515); + this.Controls.Add(this.gc_Main); + this.Controls.Add(this.toolBarMenu1); + this.Controls.Add(this.PageBar1); + this.Name = "User"; + this.Text = "User"; + ((System.ComponentModel.ISupportInitialize)(this.gc_Main)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private UserControl.ToolBarMenu toolBarMenu1; + private DevExpress.XtraGrid.GridControl gc_Main; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn account; + private DevExpress.XtraGrid.Columns.GridColumn userName; + private DevExpress.XtraGrid.Columns.GridColumn tel; + private UserControls.Data.PageBar PageBar1; + private DevExpress.XtraGrid.Columns.GridColumn email; + private DevExpress.XtraGrid.Columns.GridColumn createTime; + private DevExpress.XtraGrid.Columns.GridColumn lastLoginTime; + private DevExpress.XtraGrid.Columns.GridColumn isLocked; + private DevExpress.XtraGrid.Columns.GridColumn loginCounter; + } +} \ No newline at end of file diff --git a/DevApp/Gs.DevApp/DevFrm/User/User.cs b/DevApp/Gs.DevApp/DevFrm/User/User.cs new file mode 100644 index 0000000..a8ce05c --- /dev/null +++ b/DevApp/Gs.DevApp/DevFrm/User/User.cs @@ -0,0 +1,73 @@ +锘縰sing DevExpress.XtraEditors; +using DevExpress.XtraGrid.Columns; +using DevExpress.XtraGrid.Views.Grid; +using Gs.DevApp.Models; +using Gs.DevApp.ToolBox; +using Newtonsoft.Json; +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; + +namespace Gs.DevApp.DevFrm.User +{ + public partial class User : DevExpress.XtraEditors.XtraForm + { + public User() + { + InitializeComponent(); + this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; + PageBar1.williamPagerEvent += CtrlGridPaging1_williamPagerEvent; + GetPageList(1, 10); + + } + + private void CtrlGridPaging1_williamPagerEvent(int curPage, int pageSize) + { + //MessageBox.Show("褰撳墠椤碉細" + curPage + "锛屾瘡椤靛睍绀猴細" + pageSize + "鏉�"); + GetPageList(curPage, pageSize); + } + + private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) + { + UserAdd frm = new UserAdd(""); + frm.ShowDialog(); + } + + /// <summary> + /// + /// </summary> + /// <param name="curPage">绗嚑椤�</param> + /// <param name="pageSize">姣忛〉鍑犳潯</param> + private void GetPageList(int curPage, int pageSize) + { + Models.PageQueryModel pgq = new Models.PageQueryModel(curPage, pageSize, "userName", "asc", "", ""); + string json = JsonConvert.SerializeObject(pgq); + string strReturn = ""; + try + { + strReturn = UtilityHelper.HttpPost("", "User/GetListPage", json); + ReturnModel<PageListModel> dd = UtilityHelper.GetTableByJson(strReturn); + DataTable dt = dd.rtnData.list; + gc_Main.BindingContext = new BindingContext(); + gc_Main.DataSource = dt; + gc_Main.ForceInitialize(); + int dddd = dd.rtnData.pages;//鎬婚〉 + PageBar1.TotalPages = dddd; + PageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟 + PageBar1.CurrentPage = curPage;//褰撳墠椤� + PageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず + PageBar1.setTxt(); + } + catch (Exception ex) + { + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + } + } +} \ No newline at end of file diff --git a/DevApp/Gs.DevApp/DevFrm/User/User.resx b/DevApp/Gs.DevApp/DevFrm/User/User.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DevApp/Gs.DevApp/DevFrm/User/User.resx @@ -0,0 +1,120 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file diff --git a/DevApp/Gs.DevApp/DevFrm/User/UserAdd.Designer.cs b/DevApp/Gs.DevApp/DevFrm/User/UserAdd.Designer.cs new file mode 100644 index 0000000..62e784d --- /dev/null +++ b/DevApp/Gs.DevApp/DevFrm/User/UserAdd.Designer.cs @@ -0,0 +1,376 @@ +锘� +namespace Gs.DevApp.DevFrm.User +{ + partial class UserAdd + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.panel1 = new System.Windows.Forms.Panel(); + this.lbGuid = new System.Windows.Forms.Label(); + this.btnEsc = new DevExpress.XtraEditors.SimpleButton(); + this.btnSave = new DevExpress.XtraEditors.SimpleButton(); + this.labelControl12 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl9 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl6 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl5 = new DevExpress.XtraEditors.LabelControl(); + this.txtLock = new DevExpress.XtraEditors.ComboBoxEdit(); + this.txtPwd = new DevExpress.XtraEditors.TextEdit(); + this.labelControl4 = new DevExpress.XtraEditors.LabelControl(); + this.txtUserName = new DevExpress.XtraEditors.TextEdit(); + this.labelControl2 = new DevExpress.XtraEditors.LabelControl(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.textEmail = new DevExpress.XtraEditors.TextEdit(); + this.textTel = new DevExpress.XtraEditors.TextEdit(); + this.labelControl1 = new DevExpress.XtraEditors.LabelControl(); + this.textAddress = new DevExpress.XtraEditors.TextEdit(); + this.labelControl3 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl7 = new DevExpress.XtraEditors.LabelControl(); + this.txtRemark = new DevExpress.XtraEditors.MemoEdit(); + this.txtAccount = new DevExpress.XtraEditors.TextEdit(); + this.labelControl8 = new DevExpress.XtraEditors.LabelControl(); + this.labelControl10 = new DevExpress.XtraEditors.LabelControl(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.txtLock.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtPwd.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtUserName.Properties)).BeginInit(); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.textEmail.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textTel.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.textAddress.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtRemark.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtAccount.Properties)).BeginInit(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.Controls.Add(this.labelControl10); + this.panel1.Controls.Add(this.txtAccount); + this.panel1.Controls.Add(this.labelControl8); + this.panel1.Controls.Add(this.txtRemark); + this.panel1.Controls.Add(this.labelControl7); + this.panel1.Controls.Add(this.textAddress); + this.panel1.Controls.Add(this.labelControl3); + this.panel1.Controls.Add(this.textTel); + this.panel1.Controls.Add(this.labelControl1); + this.panel1.Controls.Add(this.textEmail); + this.panel1.Controls.Add(this.lbGuid); + this.panel1.Controls.Add(this.btnEsc); + this.panel1.Controls.Add(this.btnSave); + this.panel1.Controls.Add(this.labelControl12); + this.panel1.Controls.Add(this.labelControl9); + this.panel1.Controls.Add(this.labelControl6); + this.panel1.Controls.Add(this.labelControl5); + this.panel1.Controls.Add(this.txtLock); + this.panel1.Controls.Add(this.txtPwd); + this.panel1.Controls.Add(this.labelControl4); + this.panel1.Controls.Add(this.txtUserName); + this.panel1.Controls.Add(this.labelControl2); + this.panel1.Location = new System.Drawing.Point(57, 6); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(585, 507); + this.panel1.TabIndex = 0; + // + // lbGuid + // + this.lbGuid.AutoSize = true; + this.lbGuid.Location = new System.Drawing.Point(56, 469); + this.lbGuid.Name = "lbGuid"; + this.lbGuid.Size = new System.Drawing.Size(39, 18); + this.lbGuid.TabIndex = 1; + this.lbGuid.Text = "guid:"; + // + // btnEsc + // + this.btnEsc.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.reviewingpane_32x32; + this.btnEsc.Location = new System.Drawing.Point(240, 416); + this.btnEsc.Name = "btnEsc"; + this.btnEsc.Size = new System.Drawing.Size(94, 29); + this.btnEsc.TabIndex = 111; + this.btnEsc.Text = "鍙栨秷"; + // + // btnSave + // + this.btnSave.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.checkbox2_32x321; + this.btnSave.Location = new System.Drawing.Point(109, 416); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(94, 29); + this.btnSave.TabIndex = 110; + this.btnSave.Text = "淇濆瓨"; + // + // labelControl12 + // + this.labelControl12.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl12.Appearance.Options.UseForeColor = true; + this.labelControl12.Location = new System.Drawing.Point(418, 55); + this.labelControl12.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl12.Name = "labelControl12"; + this.labelControl12.Size = new System.Drawing.Size(8, 18); + this.labelControl12.TabIndex = 107; + this.labelControl12.Text = "*"; + // + // labelControl9 + // + this.labelControl9.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl9.Appearance.Options.UseForeColor = true; + this.labelControl9.Location = new System.Drawing.Point(415, 98); + this.labelControl9.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl9.Name = "labelControl9"; + this.labelControl9.Size = new System.Drawing.Size(8, 18); + this.labelControl9.TabIndex = 108; + this.labelControl9.Text = "*"; + // + // labelControl6 + // + this.labelControl6.Location = new System.Drawing.Point(61, 155); + this.labelControl6.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl6.Name = "labelControl6"; + this.labelControl6.Size = new System.Drawing.Size(45, 18); + this.labelControl6.TabIndex = 103; + this.labelControl6.Text = "閭锛�"; + // + // labelControl5 + // + this.labelControl5.Location = new System.Drawing.Point(31, 370); + this.labelControl5.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl5.Name = "labelControl5"; + this.labelControl5.Size = new System.Drawing.Size(75, 18); + this.labelControl5.TabIndex = 101; + this.labelControl5.Text = "閿佸畾璐﹀彿锛�"; + // + // txtLock + // + this.txtLock.Location = new System.Drawing.Point(111, 366); + this.txtLock.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.txtLock.Name = "txtLock"; + this.txtLock.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { + new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); + this.txtLock.Properties.Items.AddRange(new object[] { + "-璇烽�夋嫨-", + "绐椾綋绫诲瀷", + "鎸夐挳绫诲瀷"}); + this.txtLock.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; + this.txtLock.Size = new System.Drawing.Size(297, 24); + this.txtLock.TabIndex = 100; + // + // txtPwd + // + this.txtPwd.Location = new System.Drawing.Point(109, 53); + this.txtPwd.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.txtPwd.Name = "txtPwd"; + this.txtPwd.Size = new System.Drawing.Size(297, 24); + this.txtPwd.TabIndex = 99; + // + // labelControl4 + // + this.labelControl4.Location = new System.Drawing.Point(31, 57); + this.labelControl4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl4.Name = "labelControl4"; + this.labelControl4.Size = new System.Drawing.Size(75, 18); + this.labelControl4.TabIndex = 98; + this.labelControl4.Text = "鍒濆瀵嗙爜锛�"; + // + // txtUserName + // + this.txtUserName.Location = new System.Drawing.Point(111, 89); + this.txtUserName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.txtUserName.Name = "txtUserName"; + this.txtUserName.Size = new System.Drawing.Size(297, 24); + this.txtUserName.TabIndex = 95; + // + // labelControl2 + // + this.labelControl2.Location = new System.Drawing.Point(61, 93); + this.labelControl2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl2.Name = "labelControl2"; + this.labelControl2.Size = new System.Drawing.Size(45, 18); + this.labelControl2.TabIndex = 94; + this.labelControl2.Text = "濮撳悕锛�"; + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(853, 583); + this.tabControl1.TabIndex = 2; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.panel1); + this.tabPage1.Location = new System.Drawing.Point(4, 27); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(845, 552); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "鍩虹淇℃伅"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // textEmail + // + this.textEmail.Location = new System.Drawing.Point(109, 152); + this.textEmail.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.textEmail.Name = "textEmail"; + this.textEmail.Size = new System.Drawing.Size(297, 24); + this.textEmail.TabIndex = 120; + // + // textTel + // + this.textTel.Location = new System.Drawing.Point(109, 196); + this.textTel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.textTel.Name = "textTel"; + this.textTel.Size = new System.Drawing.Size(297, 24); + this.textTel.TabIndex = 122; + // + // labelControl1 + // + this.labelControl1.Location = new System.Drawing.Point(61, 200); + this.labelControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl1.Name = "labelControl1"; + this.labelControl1.Size = new System.Drawing.Size(45, 18); + this.labelControl1.TabIndex = 121; + this.labelControl1.Text = "鐢佃瘽锛�"; + // + // textAddress + // + this.textAddress.Location = new System.Drawing.Point(109, 240); + this.textAddress.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.textAddress.Name = "textAddress"; + this.textAddress.Size = new System.Drawing.Size(297, 24); + this.textAddress.TabIndex = 124; + // + // labelControl3 + // + this.labelControl3.Location = new System.Drawing.Point(31, 244); + this.labelControl3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl3.Name = "labelControl3"; + this.labelControl3.Size = new System.Drawing.Size(75, 18); + this.labelControl3.TabIndex = 123; + this.labelControl3.Text = "浣忓鍦板潃锛�"; + // + // labelControl7 + // + this.labelControl7.Location = new System.Drawing.Point(61, 285); + this.labelControl7.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl7.Name = "labelControl7"; + this.labelControl7.Size = new System.Drawing.Size(45, 18); + this.labelControl7.TabIndex = 125; + this.labelControl7.Text = "澶囨敞锛�"; + // + // txtRemark + // + this.txtRemark.Location = new System.Drawing.Point(109, 272); + this.txtRemark.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.txtRemark.Name = "txtRemark"; + this.txtRemark.Properties.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.txtRemark.Size = new System.Drawing.Size(297, 68); + this.txtRemark.TabIndex = 126; + // + // txtAccount + // + this.txtAccount.Location = new System.Drawing.Point(109, 16); + this.txtAccount.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.txtAccount.Name = "txtAccount"; + this.txtAccount.Size = new System.Drawing.Size(297, 24); + this.txtAccount.TabIndex = 128; + // + // labelControl8 + // + this.labelControl8.Location = new System.Drawing.Point(31, 20); + this.labelControl8.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl8.Name = "labelControl8"; + this.labelControl8.Size = new System.Drawing.Size(75, 18); + this.labelControl8.TabIndex = 127; + this.labelControl8.Text = "鐧诲綍璐﹀彿锛�"; + // + // labelControl10 + // + this.labelControl10.Appearance.ForeColor = System.Drawing.Color.Red; + this.labelControl10.Appearance.Options.UseForeColor = true; + this.labelControl10.Location = new System.Drawing.Point(418, 29); + this.labelControl10.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.labelControl10.Name = "labelControl10"; + this.labelControl10.Size = new System.Drawing.Size(8, 18); + this.labelControl10.TabIndex = 129; + this.labelControl10.Text = "*"; + // + // UserAdd + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(853, 583); + this.Controls.Add(this.tabControl1); + this.Name = "UserAdd"; + this.Text = "UserAdd"; + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.txtLock.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtPwd.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtUserName.Properties)).EndInit(); + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.textEmail.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textTel.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.textAddress.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtRemark.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtAccount.Properties)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label lbGuid; + private DevExpress.XtraEditors.SimpleButton btnEsc; + private DevExpress.XtraEditors.SimpleButton btnSave; + private DevExpress.XtraEditors.LabelControl labelControl12; + private DevExpress.XtraEditors.LabelControl labelControl9; + private DevExpress.XtraEditors.LabelControl labelControl6; + private DevExpress.XtraEditors.LabelControl labelControl5; + private DevExpress.XtraEditors.ComboBoxEdit txtLock; + private DevExpress.XtraEditors.TextEdit txtPwd; + private DevExpress.XtraEditors.LabelControl labelControl4; + private DevExpress.XtraEditors.TextEdit txtUserName; + private DevExpress.XtraEditors.LabelControl labelControl2; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabPage1; + private DevExpress.XtraEditors.LabelControl labelControl7; + private DevExpress.XtraEditors.TextEdit textAddress; + private DevExpress.XtraEditors.LabelControl labelControl3; + private DevExpress.XtraEditors.TextEdit textTel; + private DevExpress.XtraEditors.LabelControl labelControl1; + private DevExpress.XtraEditors.TextEdit textEmail; + private DevExpress.XtraEditors.TextEdit txtAccount; + private DevExpress.XtraEditors.LabelControl labelControl8; + private DevExpress.XtraEditors.MemoEdit txtRemark; + private DevExpress.XtraEditors.LabelControl labelControl10; + } +} \ No newline at end of file diff --git a/DevApp/Gs.DevApp/DevFrm/User/UserAdd.cs b/DevApp/Gs.DevApp/DevFrm/User/UserAdd.cs new file mode 100644 index 0000000..198979c --- /dev/null +++ b/DevApp/Gs.DevApp/DevFrm/User/UserAdd.cs @@ -0,0 +1,87 @@ +锘縰sing DevExpress.XtraEditors; +using Gs.DevApp.Models; +using Gs.DevApp.ToolBox; +using Newtonsoft.Json; +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; + +namespace Gs.DevApp.DevFrm.User +{ + public partial class UserAdd : DevExpress.XtraEditors.XtraForm + { + public UserAdd(string guid) + { + InitializeComponent(); + btnSave.Click += BtnSave_Click; + btnEsc.Click += BtnEsc_Click; + lbGuid.Text = guid; + } + + private void BtnEsc_Click(object sender, EventArgs e) + { + this.Dispose(); + } + + private void BtnSave_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(txtAccount.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("鐧诲綍璐﹀彿涓嶈兘涓虹┖锛�"); + txtAccount.Focus(); + return; + } + if (string.IsNullOrEmpty(txtPwd.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("瀵嗙爜涓嶈兘涓虹┖锛�"); + txtPwd.Focus(); + return; + } + if (string.IsNullOrEmpty(txtUserName.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("鑿滃崟鐘舵�佷笉鑳戒负绌猴紒"); + txtUserName.Focus(); + return; + } + var _obj = new + { + account = "string", + password = "3fa85f64-5717-4562-b3fc-2c963f66afa6", + userName = "string", + address = "string", + tel = "string", + email = "string", + isLocked = 0, + flagAdmin = 0, + flagOnline = 0, + loginCounter = 0, + workerID = "string", + remark = "string", + departGuid = "3fa85f64-5717-4562-b3fc-2c963f66afa6", + isSys = 0 + }; + string strJson = ""; + try + { + strJson = UtilityHelper.HttpPost("", "User/EditModel", JsonConvert.SerializeObject(_obj)); + ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.GetDataByJson(strJson); + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + if (_rtn.rtnCode > 0) + { + + } + } + catch (Exception ex) + { + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + } + + } +} \ No newline at end of file diff --git a/DevApp/Gs.DevApp/DevFrm/User/UserAdd.resx b/DevApp/Gs.DevApp/DevFrm/User/UserAdd.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DevApp/Gs.DevApp/DevFrm/User/UserAdd.resx @@ -0,0 +1,120 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file -- Gitblit v1.9.3