| | |
| | | } |
| | | else |
| | | { |
| | | ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | sdf.SetCaption("执行进度(" + (i - 10) + "/" + i.ToString() + ")"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | sdf.Close(); |
| | | ToolBox.MsgHelper.ShowError("提示:" + ex.Message); |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | return; |
| | | } |
| | | sdf.Close(); |
| | |
| | | this.barButtonItem5 = new DevExpress.XtraBars.BarButtonItem(); |
| | | this.fluentFormDefaultManager1 = new DevExpress.XtraBars.FluentDesignSystem.FluentFormDefaultManager(this.components); |
| | | this.acrd = new DevExpress.XtraBars.Navigation.AccordionControl(); |
| | | this.accordionControlElement1 = new DevExpress.XtraBars.Navigation.AccordionControlElement(); |
| | | this.fluentDesignFormContainer1.SuspendLayout(); |
| | | this.statusStrip1.SuspendLayout(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.tab)).BeginInit(); |
| | |
| | | // acrd |
| | | // |
| | | this.acrd.Dock = System.Windows.Forms.DockStyle.Left; |
| | | this.acrd.Elements.AddRange(new DevExpress.XtraBars.Navigation.AccordionControlElement[] { |
| | | this.accordionControlElement1}); |
| | | this.acrd.Location = new System.Drawing.Point(0, 39); |
| | | this.acrd.Name = "acrd"; |
| | | this.acrd.ScrollBarMode = DevExpress.XtraBars.Navigation.ScrollBarMode.Touch; |
| | | this.acrd.Size = new System.Drawing.Size(208, 727); |
| | | this.acrd.TabIndex = 1; |
| | | this.acrd.ViewType = DevExpress.XtraBars.Navigation.AccordionControlViewType.HamburgerMenu; |
| | | // |
| | | // accordionControlElement1 |
| | | // |
| | | this.accordionControlElement1.Name = "accordionControlElement1"; |
| | | this.accordionControlElement1.Text = "Element1"; |
| | | // |
| | | // FrmMain |
| | | // |
| | |
| | | private DevExpress.XtraBars.BarButtonItem barButtonItem5; |
| | | private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel3; |
| | | private System.Windows.Forms.ToolStripStatusLabel toolTime; |
| | | private DevExpress.XtraBars.Navigation.AccordionControlElement accordionControlElement1; |
| | | } |
| | | } |
| | |
| | | _grp.Name = _dy["guid"].ToString(); |
| | | _grp.Style = DevExpress.XtraBars.Navigation.ElementStyle.Group; |
| | | _grp.Text = _dy["name"].ToString(); |
| | | _grp.Tag = _dy["fromPath"].ToString(); |
| | | _grp.Tag = _dy["formPath"].ToString(); |
| | | _grp.Click += _grp_Click; |
| | | DataRow[] drItem = dt.Select("upGuid='" + _dy["guid"].ToString() + "'"); |
| | | foreach (DataRow _dy2 in drItem) |
| | |
| | | _itm.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; |
| | | _itm.Text = _dy2["name"].ToString(); |
| | | _itm.Appearance.Normal.Font = new System.Drawing.Font("Tahoma", 10F); |
| | | _itm.Tag = _dy2["fromPath"].ToString(); |
| | | _itm.Tag = _dy2["formPath"].ToString(); |
| | | _itm.Click += _grp_Click; |
| | | _grp.Elements.Add(_itm); |
| | | }; |
| | |
| | | this.tlcModuleID.Name = "tlcModuleID"; |
| | | this.tlcModuleID.Visible = true; |
| | | this.tlcModuleID.VisibleIndex = 5; |
| | | this.tlcModuleID.Width = 74; |
| | | this.tlcModuleID.Width = 103; |
| | | // |
| | | // tlcMenuName |
| | | // |
| | |
| | | this.tlcMenuName.Name = "tlcMenuName"; |
| | | this.tlcMenuName.Visible = true; |
| | | this.tlcMenuName.VisibleIndex = 0; |
| | | this.tlcMenuName.Width = 219; |
| | | this.tlcMenuName.Width = 215; |
| | | // |
| | | // tlcParentMenuName |
| | | // |
| | | this.tlcParentMenuName.Caption = "状态"; |
| | | this.tlcParentMenuName.FieldName = "status"; |
| | | this.tlcParentMenuName.FieldName = "statusTxt"; |
| | | this.tlcParentMenuName.MinWidth = 23; |
| | | this.tlcParentMenuName.Name = "tlcParentMenuName"; |
| | | this.tlcParentMenuName.Visible = true; |
| | | this.tlcParentMenuName.VisibleIndex = 4; |
| | | this.tlcParentMenuName.Width = 96; |
| | | this.tlcParentMenuName.Width = 64; |
| | | // |
| | | // tlcMenuCaption |
| | | // |
| | | this.tlcMenuCaption.Caption = "窗体路径"; |
| | | this.tlcMenuCaption.FieldName = "fromPath"; |
| | | this.tlcMenuCaption.FieldName = "formPath"; |
| | | this.tlcMenuCaption.MinWidth = 23; |
| | | this.tlcMenuCaption.Name = "tlcMenuCaption"; |
| | | this.tlcMenuCaption.Visible = true; |
| | | this.tlcMenuCaption.VisibleIndex = 2; |
| | | this.tlcMenuCaption.Width = 96; |
| | | this.tlcMenuCaption.Width = 139; |
| | | // |
| | | // tlcActions |
| | | // |
| | | this.tlcActions.Caption = "窗体类型"; |
| | | this.tlcActions.FieldName = "category"; |
| | | this.tlcActions.FieldName = "categoryTxt"; |
| | | this.tlcActions.MinWidth = 23; |
| | | this.tlcActions.Name = "tlcActions"; |
| | | this.tlcActions.Visible = true; |
| | | this.tlcActions.VisibleIndex = 3; |
| | | this.tlcActions.Width = 96; |
| | | this.tlcActions.Width = 50; |
| | | // |
| | | // tlcMenuType |
| | | // |
| | | this.tlcMenuType.Caption = "序号"; |
| | | this.tlcMenuType.Caption = "排序号"; |
| | | this.tlcMenuType.FieldName = "idx"; |
| | | this.tlcMenuType.MinWidth = 23; |
| | | this.tlcMenuType.Name = "tlcMenuType"; |
| | | this.tlcMenuType.Visible = true; |
| | | this.tlcMenuType.VisibleIndex = 1; |
| | | this.tlcMenuType.Width = 95; |
| | | this.tlcMenuType.Width = 50; |
| | | // |
| | | // treeListColumn1 |
| | | // |
| | |
| | | this.treeListColumn1.Name = "treeListColumn1"; |
| | | this.treeListColumn1.Visible = true; |
| | | this.treeListColumn1.VisibleIndex = 6; |
| | | this.treeListColumn1.Width = 104; |
| | | // |
| | | // SysMenu |
| | | // |
| | |
| | | using DevExpress.XtraEditors; |
| | | using Gs.DevApp.Models; |
| | | 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 |
| | | { |
| | |
| | | this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; |
| | | this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick; |
| | | this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; |
| | | this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | } |
| | | |
| | | private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e) |
| | | { |
| | | getTree(); |
| | | } |
| | | |
| | | private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e) |
| | |
| | | ToolBox.MsgHelper.Warning("请先选择你要删除的行!"); |
| | | return; |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + tlMenu.FocusedNode.GetValue("name") + "】,确定删除吗?")) |
| | | { |
| | | return; |
| | | } |
| | | var _obj = new |
| | | { |
| | | guid = rowGuid,//主建 |
| | | }; |
| | | string json = JsonConvert.SerializeObject(_obj); |
| | | string strReturn = ""; |
| | | string strJson = ""; |
| | | try |
| | | { |
| | | strReturn= UtilityHelper.HttpPost("", "MenuAction/DeleteModel", json); |
| | | |
| | | strJson = UtilityHelper.HttpPost("", "MenuAction/DeleteModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.GetDataByJson(strJson); |
| | | if (_rtn.rtnCode > 0) { getTree(); } |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | this.tlMenu.Tag = "name"; |
| | | this.tlMenu.EndUpdate(); |
| | | this.tlMenu.ExpandAll(); |
| | | tlMenu.OptionsView.CheckBoxStyle = DevExpress.XtraTreeList.DefaultNodeCheckBoxStyle.Radio; |
| | | tlMenu.OptionsView.CheckBoxStyle = DevExpress.XtraTreeList.DefaultNodeCheckBoxStyle.Default; |
| | | // 设置不关联选择 |
| | | //tlMenu.OptionsSelection.MultiSelect = true; |
| | | //// tlMenu.OptionsSelection.MaintainState = false; // 关键设置 |
| | | //tlMenu.OptionsSelection.MaintainState = false; // 关键设置 |
| | | //this.tlMenu.OptionsBehavior.AllowIndeterminateCheckState = true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | this.btnEsc = new DevExpress.XtraEditors.SimpleButton(); |
| | | this.btnSave = new DevExpress.XtraEditors.SimpleButton(); |
| | | this.labelControl12 = new DevExpress.XtraEditors.LabelControl(); |
| | | this.labelControl10 = new DevExpress.XtraEditors.LabelControl(); |
| | | this.labelControl9 = new DevExpress.XtraEditors.LabelControl(); |
| | | this.labelControl8 = new DevExpress.XtraEditors.LabelControl(); |
| | | this.labelControl6 = new DevExpress.XtraEditors.LabelControl(); |
| | | this.txtFormNamespace = new DevExpress.XtraEditors.MemoEdit(); |
| | | this.labelControl5 = new DevExpress.XtraEditors.LabelControl(); |
| | |
| | | this.txtMenuName = new DevExpress.XtraEditors.TextEdit(); |
| | | this.labelControl2 = new DevExpress.XtraEditors.LabelControl(); |
| | | this.panel1 = new System.Windows.Forms.Panel(); |
| | | this.lbGuid = new System.Windows.Forms.Label(); |
| | | this.label2 = new System.Windows.Forms.Label(); |
| | | this.label1 = new System.Windows.Forms.Label(); |
| | | this.labelControl8 = new DevExpress.XtraEditors.LabelControl(); |
| | | this.txtParentMenuName = new DevExpress.XtraEditors.TreeListLookUpEdit(); |
| | | this.treeListLookUpEdit1TreeList = new DevExpress.XtraTreeList.TreeList(); |
| | | this.tabPage1 = new System.Windows.Forms.TabPage(); |
| | | this.tabControl1 = new System.Windows.Forms.TabControl(); |
| | | this.lbGuid = new System.Windows.Forms.Label(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.txtStatus.Properties)).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.txtIdx)).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.txtFormNamespace.Properties)).BeginInit(); |
| | |
| | | // |
| | | // labelControl7 |
| | | // |
| | | this.labelControl7.Location = new System.Drawing.Point(33, 273); |
| | | this.labelControl7.Location = new System.Drawing.Point(33, 232); |
| | | 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); |
| | |
| | | // |
| | | // txtStatus |
| | | // |
| | | this.txtStatus.Location = new System.Drawing.Point(111, 269); |
| | | this.txtStatus.Location = new System.Drawing.Point(111, 228); |
| | | 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[] { |
| | |
| | | // |
| | | // txtIdx |
| | | // |
| | | this.txtIdx.Location = new System.Drawing.Point(111, 236); |
| | | this.txtIdx.Location = new System.Drawing.Point(111, 267); |
| | | this.txtIdx.Name = "txtIdx"; |
| | | this.txtIdx.Size = new System.Drawing.Size(120, 26); |
| | | this.txtIdx.TabIndex = 113; |
| | | // |
| | | // labelControl1 |
| | | // |
| | | this.labelControl1.Location = new System.Drawing.Point(30, 244); |
| | | this.labelControl1.Location = new System.Drawing.Point(30, 275); |
| | | this.labelControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); |
| | | this.labelControl1.Name = "labelControl1"; |
| | | this.labelControl1.Size = new System.Drawing.Size(75, 18); |
| | |
| | | // |
| | | // btnEsc |
| | | // |
| | | this.btnEsc.Location = new System.Drawing.Point(299, 342); |
| | | this.btnEsc.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.reviewingpane_32x32; |
| | | this.btnEsc.Location = new System.Drawing.Point(242, 333); |
| | | this.btnEsc.Name = "btnEsc"; |
| | | this.btnEsc.Size = new System.Drawing.Size(94, 29); |
| | | this.btnEsc.TabIndex = 111; |
| | |
| | | // |
| | | // btnSave |
| | | // |
| | | this.btnSave.Location = new System.Drawing.Point(129, 343); |
| | | this.btnSave.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.checkbox2_32x321; |
| | | this.btnSave.Location = new System.Drawing.Point(111, 333); |
| | | this.btnSave.Name = "btnSave"; |
| | | this.btnSave.Size = new System.Drawing.Size(94, 29); |
| | | this.btnSave.TabIndex = 110; |
| | |
| | | // |
| | | this.labelControl12.Appearance.ForeColor = System.Drawing.Color.Red; |
| | | this.labelControl12.Appearance.Options.UseForeColor = true; |
| | | this.labelControl12.Location = new System.Drawing.Point(415, 121); |
| | | this.labelControl12.Location = new System.Drawing.Point(418, 49); |
| | | 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 = "*"; |
| | | // |
| | | // labelControl10 |
| | | // |
| | | this.labelControl10.Appearance.ForeColor = System.Drawing.Color.Red; |
| | | this.labelControl10.Appearance.Options.UseForeColor = true; |
| | | this.labelControl10.Location = new System.Drawing.Point(415, 92); |
| | | 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 = 109; |
| | | this.labelControl10.Text = "*"; |
| | | // |
| | | // labelControl9 |
| | | // |
| | | this.labelControl9.Appearance.ForeColor = System.Drawing.Color.Red; |
| | | this.labelControl9.Appearance.Options.UseForeColor = true; |
| | | this.labelControl9.Location = new System.Drawing.Point(415, 57); |
| | | this.labelControl9.Location = new System.Drawing.Point(415, 89); |
| | | 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 = "*"; |
| | | // |
| | | // labelControl8 |
| | | // |
| | | this.labelControl8.Appearance.ForeColor = System.Drawing.Color.Red; |
| | | this.labelControl8.Appearance.Options.UseForeColor = true; |
| | | this.labelControl8.Location = new System.Drawing.Point(415, 14); |
| | | this.labelControl8.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); |
| | | this.labelControl8.Name = "labelControl8"; |
| | | this.labelControl8.Size = new System.Drawing.Size(8, 18); |
| | | this.labelControl8.TabIndex = 106; |
| | | this.labelControl8.Text = "*"; |
| | | // |
| | | // labelControl6 |
| | | // |
| | |
| | | // |
| | | // labelControl5 |
| | | // |
| | | this.labelControl5.Location = new System.Drawing.Point(33, 121); |
| | | this.labelControl5.Location = new System.Drawing.Point(36, 49); |
| | | 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 = "窗体类型:"; |
| | | this.labelControl5.Text = "菜单类型:"; |
| | | // |
| | | // txtMenuType |
| | | // |
| | | this.txtMenuType.Location = new System.Drawing.Point(111, 117); |
| | | this.txtMenuType.Location = new System.Drawing.Point(114, 45); |
| | | this.txtMenuType.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); |
| | | this.txtMenuType.Name = "txtMenuType"; |
| | | this.txtMenuType.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { |
| | |
| | | // |
| | | // txtMenuIco |
| | | // |
| | | this.txtMenuIco.Location = new System.Drawing.Point(111, 83); |
| | | this.txtMenuIco.Location = new System.Drawing.Point(111, 115); |
| | | this.txtMenuIco.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); |
| | | this.txtMenuIco.Name = "txtMenuIco"; |
| | | this.txtMenuIco.Size = new System.Drawing.Size(297, 24); |
| | |
| | | // |
| | | // labelControl4 |
| | | // |
| | | this.labelControl4.Location = new System.Drawing.Point(33, 87); |
| | | this.labelControl4.Location = new System.Drawing.Point(33, 119); |
| | | 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); |
| | |
| | | // |
| | | // txtMenuName |
| | | // |
| | | this.txtMenuName.Location = new System.Drawing.Point(111, 48); |
| | | this.txtMenuName.Location = new System.Drawing.Point(111, 80); |
| | | this.txtMenuName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); |
| | | this.txtMenuName.Name = "txtMenuName"; |
| | | this.txtMenuName.Size = new System.Drawing.Size(297, 24); |
| | |
| | | // |
| | | // labelControl2 |
| | | // |
| | | this.labelControl2.Location = new System.Drawing.Point(33, 52); |
| | | this.labelControl2.Location = new System.Drawing.Point(33, 84); |
| | | this.labelControl2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); |
| | | this.labelControl2.Name = "labelControl2"; |
| | | this.labelControl2.Size = new System.Drawing.Size(75, 18); |
| | |
| | | // |
| | | // panel1 |
| | | // |
| | | this.panel1.Controls.Add(this.lbGuid); |
| | | this.panel1.Controls.Add(this.label2); |
| | | this.panel1.Controls.Add(this.label1); |
| | | this.panel1.Controls.Add(this.labelControl8); |
| | | this.panel1.Controls.Add(this.txtParentMenuName); |
| | | this.panel1.Controls.Add(this.labelControl7); |
| | | this.panel1.Controls.Add(this.txtStatus); |
| | |
| | | this.panel1.Controls.Add(this.btnEsc); |
| | | this.panel1.Controls.Add(this.btnSave); |
| | | this.panel1.Controls.Add(this.labelControl12); |
| | | this.panel1.Controls.Add(this.labelControl10); |
| | | this.panel1.Controls.Add(this.labelControl9); |
| | | this.panel1.Controls.Add(this.labelControl8); |
| | | this.panel1.Controls.Add(this.labelControl6); |
| | | this.panel1.Controls.Add(this.txtFormNamespace); |
| | | this.panel1.Controls.Add(this.labelControl5); |
| | |
| | | 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(480, 425); |
| | | this.panel1.Size = new System.Drawing.Size(585, 402); |
| | | this.panel1.TabIndex = 0; |
| | | // |
| | | // lbGuid |
| | | // |
| | | this.lbGuid.AutoSize = true; |
| | | this.lbGuid.Location = new System.Drawing.Point(66, 373); |
| | | this.lbGuid.Name = "lbGuid"; |
| | | this.lbGuid.Size = new System.Drawing.Size(39, 18); |
| | | this.lbGuid.TabIndex = 1; |
| | | this.lbGuid.Text = "guid:"; |
| | | // |
| | | // label2 |
| | | // |
| | | this.label2.AutoSize = true; |
| | | this.label2.Location = new System.Drawing.Point(412, 155); |
| | | this.label2.Name = "label2"; |
| | | this.label2.Size = new System.Drawing.Size(158, 36); |
| | | this.label2.TabIndex = 119; |
| | | this.label2.Text = "(窗体的命名空间全称\r\n ,父菜单可为空)"; |
| | | // |
| | | // label1 |
| | | // |
| | | this.label1.AutoSize = true; |
| | | this.label1.Location = new System.Drawing.Point(412, 14); |
| | | this.label1.Name = "label1"; |
| | | this.label1.Size = new System.Drawing.Size(143, 18); |
| | | this.label1.TabIndex = 118; |
| | | this.label1.Text = "(空将为一级菜单)"; |
| | | // |
| | | // labelControl8 |
| | | // |
| | | this.labelControl8.Appearance.ForeColor = System.Drawing.Color.Red; |
| | | this.labelControl8.Appearance.Options.UseForeColor = true; |
| | | this.labelControl8.Location = new System.Drawing.Point(415, 234); |
| | | this.labelControl8.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); |
| | | this.labelControl8.Name = "labelControl8"; |
| | | this.labelControl8.Size = new System.Drawing.Size(8, 18); |
| | | this.labelControl8.TabIndex = 117; |
| | | this.labelControl8.Text = "*"; |
| | | // |
| | | // txtParentMenuName |
| | | // |
| | | this.txtParentMenuName.Location = new System.Drawing.Point(114, 11); |
| | | this.txtParentMenuName.EditValue = "无可奈何花落去"; |
| | | this.txtParentMenuName.Location = new System.Drawing.Point(111, 11); |
| | | this.txtParentMenuName.Name = "txtParentMenuName"; |
| | | this.txtParentMenuName.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { |
| | | new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); |
| | | this.txtParentMenuName.Properties.TreeList = this.treeListLookUpEdit1TreeList; |
| | | this.txtParentMenuName.Size = new System.Drawing.Size(294, 24); |
| | | this.txtParentMenuName.Size = new System.Drawing.Size(297, 24); |
| | | this.txtParentMenuName.TabIndex = 116; |
| | | // |
| | | // treeListLookUpEdit1TreeList |
| | | // |
| | | this.treeListLookUpEdit1TreeList.KeyFieldName = ""; |
| | | this.treeListLookUpEdit1TreeList.Location = new System.Drawing.Point(0, 0); |
| | | this.treeListLookUpEdit1TreeList.Name = "treeListLookUpEdit1TreeList"; |
| | | this.treeListLookUpEdit1TreeList.OptionsView.ShowIndentAsRowStyle = true; |
| | | this.treeListLookUpEdit1TreeList.ParentFieldName = ""; |
| | | this.treeListLookUpEdit1TreeList.Size = new System.Drawing.Size(400, 200); |
| | | this.treeListLookUpEdit1TreeList.TabIndex = 0; |
| | | // |
| | | // tabPage1 |
| | | // |
| | | this.tabPage1.Controls.Add(this.lbGuid); |
| | | 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(707, 484); |
| | | this.tabPage1.Size = new System.Drawing.Size(650, 450); |
| | | this.tabPage1.TabIndex = 0; |
| | | this.tabPage1.Text = "tabPage1"; |
| | | this.tabPage1.Text = "基础信息"; |
| | | this.tabPage1.UseVisualStyleBackColor = true; |
| | | // |
| | | // tabControl1 |
| | |
| | | this.tabControl1.Location = new System.Drawing.Point(0, 0); |
| | | this.tabControl1.Name = "tabControl1"; |
| | | this.tabControl1.SelectedIndex = 0; |
| | | this.tabControl1.Size = new System.Drawing.Size(715, 515); |
| | | this.tabControl1.Size = new System.Drawing.Size(658, 481); |
| | | this.tabControl1.TabIndex = 1; |
| | | // |
| | | // lbGuid |
| | | // |
| | | this.lbGuid.AutoSize = true; |
| | | this.lbGuid.Location = new System.Drawing.Point(66, 438); |
| | | this.lbGuid.Name = "lbGuid"; |
| | | this.lbGuid.Size = new System.Drawing.Size(39, 18); |
| | | this.lbGuid.TabIndex = 1; |
| | | this.lbGuid.Text = "guid:"; |
| | | // |
| | | // SysMenuAdd |
| | | // |
| | | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); |
| | | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
| | | this.ClientSize = new System.Drawing.Size(715, 515); |
| | | this.ClientSize = new System.Drawing.Size(658, 481); |
| | | this.Controls.Add(this.tabControl1); |
| | | this.MaximizeBox = false; |
| | | this.MinimizeBox = false; |
| | | this.Name = "SysMenuAdd"; |
| | | this.Text = "SysMenuAdd"; |
| | | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; |
| | | this.Text = "菜单功能"; |
| | | this.TopMost = true; |
| | | ((System.ComponentModel.ISupportInitialize)(this.txtStatus.Properties)).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.txtIdx)).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.txtFormNamespace.Properties)).EndInit(); |
| | |
| | | ((System.ComponentModel.ISupportInitialize)(this.txtParentMenuName.Properties)).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.treeListLookUpEdit1TreeList)).EndInit(); |
| | | this.tabPage1.ResumeLayout(false); |
| | | this.tabPage1.PerformLayout(); |
| | | this.tabControl1.ResumeLayout(false); |
| | | this.ResumeLayout(false); |
| | | |
| | |
| | | private DevExpress.XtraEditors.SimpleButton btnEsc; |
| | | private DevExpress.XtraEditors.SimpleButton btnSave; |
| | | private DevExpress.XtraEditors.LabelControl labelControl12; |
| | | private DevExpress.XtraEditors.LabelControl labelControl10; |
| | | private DevExpress.XtraEditors.LabelControl labelControl9; |
| | | private DevExpress.XtraEditors.LabelControl labelControl8; |
| | | private DevExpress.XtraEditors.LabelControl labelControl6; |
| | | private DevExpress.XtraEditors.MemoEdit txtFormNamespace; |
| | | private DevExpress.XtraEditors.LabelControl labelControl5; |
| | |
| | | private DevExpress.XtraEditors.TreeListLookUpEdit txtParentMenuName; |
| | | private DevExpress.XtraTreeList.TreeList treeListLookUpEdit1TreeList; |
| | | private System.Windows.Forms.Label lbGuid; |
| | | private DevExpress.XtraEditors.LabelControl labelControl8; |
| | | private System.Windows.Forms.Label label2; |
| | | private System.Windows.Forms.Label label1; |
| | | } |
| | | } |
| | |
| | | using DevExpress.XtraEditors; |
| | | 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; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.Models; |
| | | using DevExpress.XtraTreeList.Nodes; |
| | |
| | | InitializeComponent(); |
| | | btnSave.Click += BtnSave_Click; |
| | | btnEsc.Click += BtnEsc_Click; |
| | | txtMenuType.TextChanged += TxtMenuType_TextChanged; |
| | | getTree(); |
| | | lbGuid.Text = guid; |
| | | getModel(); |
| | | } |
| | | |
| | | private void TxtMenuType_TextChanged(object sender, EventArgs e) |
| | | { |
| | | if (txtMenuType.SelectedIndex == 1) |
| | | { |
| | | this.txtFormNamespace.Enabled = true; |
| | | this.txtMenuIco.Enabled = true; |
| | | } |
| | | else |
| | | { |
| | | this.txtFormNamespace.Enabled = false; |
| | | this.txtMenuIco.Enabled = false; |
| | | this.txtFormNamespace.Text = ""; |
| | | this.txtMenuIco.Text = ""; |
| | | } |
| | | } |
| | | |
| | | private void BtnEsc_Click(object sender, EventArgs e) |
| | |
| | | |
| | | private void BtnSave_Click(object sender, EventArgs e) |
| | | { |
| | | if (string.IsNullOrEmpty(txtMenuName.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("菜单名称不能为空!"); |
| | | txtMenuName.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(txtMenuType.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("菜单类型不能为空!"); |
| | | txtMenuType.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(txtStatus.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("菜单状态不能为空!"); |
| | | txtStatus.Focus(); |
| | | return; |
| | | } |
| | | string _upGuid = ""; |
| | | TreeListNode focusedNode = txtParentMenuName.Properties.TreeList.FocusedNode; |
| | | if (focusedNode != null) |
| | |
| | | } |
| | | var _obj = new |
| | | { |
| | | guid = "",//主建 |
| | | guid = lbGuid.Text.Trim(),//主建 |
| | | upGuid = _upGuid,//上级的主建 |
| | | name = txtMenuName.Text.Trim(),//名称 |
| | | serialNumber = "",//编号 |
| | | icon = txtMenuIco.Text,//菜单图标 |
| | | status = txtStatus.SelectedIndex,//状态 |
| | | fromPath = txtFormNamespace.Text.Trim(),//窗体路径 |
| | | formPath = txtFormNamespace.Text.Trim(),//窗体路径 |
| | | idx = int.Parse(txtIdx.Value.ToString()),//排序 |
| | | category = txtMenuType.SelectedIndex,//类型 |
| | | }; |
| | | string json = JsonConvert.SerializeObject(_obj); |
| | | string strJson = ""; |
| | | try |
| | | { |
| | | UtilityHelper.HttpPost("", "MenuAction/EditModel", json); |
| | | strJson = UtilityHelper.HttpPost("", "MenuAction/EditModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.GetDataByJson(strJson); |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) { getTree(); } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | string strReturn = ""; |
| | | try |
| | | { |
| | | strReturn =UtilityHelper.HttpPost("", "MenuAction/GetListPage", json); |
| | | strReturn = UtilityHelper.HttpPost("", "MenuAction/GetListPage", json); |
| | | ReturnModel<PageListModel> dd = UtilityHelper.GetTableByJson(strReturn); |
| | | DataTable dt = dd.rtnData.list; |
| | | txtParentMenuName.Properties.DataSource = dt; |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void getModel() { |
| | | //_AppDomain |
| | | //string json = JsonConvert.SerializeObject(_obj); |
| | | //try |
| | | //{ |
| | | // Utility.HttpPost("", "MenuAction/GetModel", json); |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // throw ex; |
| | | //} |
| | | private void getModel() |
| | | { |
| | | if (lbGuid.Text.Length <= 0) return; |
| | | var _obj = new |
| | | { |
| | | guid = lbGuid.Text.Trim(),//主建 |
| | | }; |
| | | string strJson = ""; |
| | | try |
| | | { |
| | | strJson = UtilityHelper.HttpPost("", "MenuAction/GetModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.GetDataByJson(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | txtMenuName.Text = _rtn.rtnData.name; |
| | | txtMenuIco.Text = _rtn.rtnData.icon; |
| | | txtFormNamespace.Text = _rtn.rtnData.formPath; |
| | | txtStatus.SelectedIndex = _rtn.rtnData.status; |
| | | txtMenuType.SelectedIndex = _rtn.rtnData.category; |
| | | txtIdx.Value = _rtn.rtnData.idx; |
| | | // txtParentMenuName.Text = ""; |
| | | } |
| | | else |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <None Include="Resources\time2_16x16.png" /> |
| | | <None Include="Resources\knowledgebasearticle_16x16.png" /> |
| | | <None Include="Resources\edit_32x32.png" /> |
| | | <None Include="Resources\checkbox2_32x321.png" /> |
| | | <None Include="Resources\reviewingpane_32x32.png" /> |
| | | <Content Include="Resources\user_16x16.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup /> |
| | |
| | | /// <summary> |
| | | /// 查找 System.Drawing.Bitmap 类型的本地化资源。 |
| | | /// </summary> |
| | | internal static System.Drawing.Bitmap checkbox2_32x321 { |
| | | get { |
| | | object obj = ResourceManager.GetObject("checkbox2_32x321", resourceCulture); |
| | | return ((System.Drawing.Bitmap)(obj)); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查找 System.Drawing.Bitmap 类型的本地化资源。 |
| | | /// </summary> |
| | | internal static System.Drawing.Bitmap convert_16x16 { |
| | | get { |
| | | object obj = ResourceManager.GetObject("convert_16x16", resourceCulture); |
| | |
| | | /// <summary> |
| | | /// 查找 System.Drawing.Bitmap 类型的本地化资源。 |
| | | /// </summary> |
| | | internal static System.Drawing.Bitmap reviewingpane_32x32 { |
| | | get { |
| | | object obj = ResourceManager.GetObject("reviewingpane_32x32", resourceCulture); |
| | | return ((System.Drawing.Bitmap)(obj)); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查找 System.Drawing.Bitmap 类型的本地化资源。 |
| | | /// </summary> |
| | | internal static System.Drawing.Bitmap show_16x16 { |
| | | get { |
| | | object obj = ResourceManager.GetObject("show_16x16", resourceCulture); |
| | |
| | | <data name="converttorange_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\converttorange_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="checkbox2_32x321" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\checkbox2_32x321.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="chartsshowlegend_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\chartsshowlegend_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | |
| | | </data> |
| | | <data name="renamedatasource_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\renamedatasource_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="apply_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\apply_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="usergroup_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\usergroup_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | |
| | | <data name="converttorange_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\converttorange_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="apply_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\apply_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="3dcylinder_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\3dcylinder_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="legendnone2_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\legendnone2_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="time2_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\time2_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="show_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\show_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | |
| | | <data name="user_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\user_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="time2_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\time2_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | <data name="edit_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\edit_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="linktoprevious_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\linktoprevious_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | |
| | | <data name="listmultilevel_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\listmultilevel_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | <data name="edit_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\edit_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | <data name="reviewingpane_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
| | | <value>..\Resources\reviewingpane_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
| | | </data> |
| | | </root> |
| | |
| | | this.btnSave = new DevExpress.XtraBars.BarLargeButtonItem(); |
| | | this.btnView = new DevExpress.XtraBars.BarLargeButtonItem(); |
| | | this.barLargeButtonItem6 = new DevExpress.XtraBars.BarLargeButtonItem(); |
| | | this.barLargeButtonItem7 = new DevExpress.XtraBars.BarLargeButtonItem(); |
| | | this.btnLoad = new DevExpress.XtraBars.BarLargeButtonItem(); |
| | | this.barLargeButtonItem8 = new DevExpress.XtraBars.BarLargeButtonItem(); |
| | | this.barLargeButtonItem9 = new DevExpress.XtraBars.BarLargeButtonItem(); |
| | | this.barLargeButtonItem10 = new DevExpress.XtraBars.BarLargeButtonItem(); |
| | |
| | | this.btnView, |
| | | this.barButtonItem1, |
| | | this.barLargeButtonItem6, |
| | | this.barLargeButtonItem7, |
| | | this.btnLoad, |
| | | this.barButtonItem2, |
| | | this.barLargeButtonItem8, |
| | | this.barLargeButtonItem9, |
| | |
| | | new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.PaintStyle, this.btnSave, DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph), |
| | | new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.PaintStyle, this.btnView, DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph), |
| | | new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem6), |
| | | new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem7), |
| | | new DevExpress.XtraBars.LinkPersistInfo(this.btnLoad), |
| | | new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem8), |
| | | new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem9), |
| | | new DevExpress.XtraBars.LinkPersistInfo(this.barLargeButtonItem10)}); |
| | |
| | | this.barLargeButtonItem6.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.renamedatasource_32x32; |
| | | this.barLargeButtonItem6.Name = "barLargeButtonItem6"; |
| | | // |
| | | // barLargeButtonItem7 |
| | | // btnLoad |
| | | // |
| | | this.barLargeButtonItem7.Caption = "刷新"; |
| | | this.barLargeButtonItem7.Id = 10; |
| | | this.barLargeButtonItem7.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.convert_16x16; |
| | | this.barLargeButtonItem7.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.convert_32x32; |
| | | this.barLargeButtonItem7.Name = "barLargeButtonItem7"; |
| | | this.btnLoad.Caption = "刷新"; |
| | | this.btnLoad.Id = 10; |
| | | this.btnLoad.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.convert_16x16; |
| | | this.btnLoad.ImageOptions.LargeImage = global::Gs.DevApp.Properties.Resources.convert_32x32; |
| | | this.btnLoad.Name = "btnLoad"; |
| | | // |
| | | // barLargeButtonItem8 |
| | | // |
| | |
| | | private DevExpress.XtraBars.BarLargeButtonItem btnSave; |
| | | private DevExpress.XtraBars.BarLargeButtonItem btnView; |
| | | private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem6; |
| | | private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem7; |
| | | private DevExpress.XtraBars.BarLargeButtonItem btnLoad; |
| | | private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem8; |
| | | private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem9; |
| | | private DevExpress.XtraBars.BarLargeButtonItem barLargeButtonItem10; |
| | |
| | | /// </summary> |
| | | public event EventHandler btnEdtClick; |
| | | |
| | | /// <summary> |
| | | /// 刷新 |
| | | /// </summary> |
| | | public event EventHandler btnLoadClick; |
| | | |
| | | |
| | | public ToolBarMenu() |
| | | { |
| | | InitializeComponent(); |
| | | this.btnAdd.ItemClick += BtnAdd_ItemClick; |
| | | this.btnDel.ItemClick += BtnDel_ItemClick; |
| | | this.btnEdit.ItemClick += BtnEdit_ItemClick; |
| | | this.btnLoad.ItemClick += BtnLoad_ItemClick; |
| | | } |
| | | |
| | | private void BtnLoad_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (btnLoadClick != null) |
| | | { |
| | | btnLoadClick(this, e); |
| | | } |
| | | } |
| | | |
| | | private void BtnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | |
| | | "WorkspaceRootPath": "D:\\GsMesV2\\WebApi\\", |
| | | "Documents": [ |
| | | { |
| | | "AbsoluteMoniker": "D:0:0:{C77F6A1D-0CEA-40DE-9B03-C59B581531E8}|Gs.User\\Gs.User.csproj|d:\\gsmesv2\\webapi\\gs.user\\service\\usercontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "RelativeMoniker": "D:0:0:{C77F6A1D-0CEA-40DE-9B03-C59B581531E8}|Gs.User\\Gs.User.csproj|solutionrelative:gs.user\\service\\usercontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | "AbsoluteMoniker": "D:0:0:{C77F6A1D-0CEA-40DE-9B03-C59B581531E8}|Gs.User\\Gs.User.csproj|d:\\gsmesv2\\webapi\\gs.user\\service\\organizationcontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "RelativeMoniker": "D:0:0:{C77F6A1D-0CEA-40DE-9B03-C59B581531E8}|Gs.User\\Gs.User.csproj|solutionrelative:gs.user\\service\\organizationcontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | } |
| | | ], |
| | | "DocumentGroupContainers": [ |
| | |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 0, |
| | | "Title": "UserController.cs", |
| | | "DocumentMoniker": "D:\\GsMesV2\\WebApi\\Gs.User\\Service\\UserController.cs", |
| | | "RelativeDocumentMoniker": "Gs.User\\Service\\UserController.cs", |
| | | "ToolTip": "D:\\GsMesV2\\WebApi\\Gs.User\\Service\\UserController.cs", |
| | | "RelativeToolTip": "Gs.User\\Service\\UserController.cs", |
| | | "ViewState": "AQIAAGYAAAAAAAAAAAAywHIAAAAvAAAA", |
| | | "Title": "OrganizationController.cs", |
| | | "DocumentMoniker": "D:\\GsMesV2\\WebApi\\Gs.User\\Service\\OrganizationController.cs", |
| | | "RelativeDocumentMoniker": "Gs.User\\Service\\OrganizationController.cs", |
| | | "ToolTip": "D:\\GsMesV2\\WebApi\\Gs.User\\Service\\OrganizationController.cs", |
| | | "RelativeToolTip": "Gs.User\\Service\\OrganizationController.cs", |
| | | "ViewState": "AQIAABcAAAAAAAAAAAAYwB0AAAArAAAA", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", |
| | | "WhenOpened": "2024-08-27T14:27:24.014Z", |
| | | "WhenOpened": "2024-08-28T00:45:55.543Z", |
| | | "EditorCaption": "" |
| | | } |
| | | ] |
| | |
| | | guid = Guid.Parse(dr["guid"].ToString()), |
| | | upGuid = dr["upGuid"].ToString().Length > 0 ? Guid.Parse(dr["upGuid"].ToString()) : null, |
| | | name = dr["name"].ToString(), |
| | | serialNumber = dr["serialNumber"].ToString(), |
| | | icon = dr["icon"].ToString(), |
| | | status = int.Parse(dr["status"].ToString()), |
| | | fromPath = dr["fromPath"].ToString(), |
| | | formPath = dr["formPath"].ToString(), |
| | | idx = int.Parse(dr["idx"].ToString()), |
| | | category = int.Parse(dr["category"].ToString()), |
| | | statusTxt = (dr["status"].ToString() == "1" ? "正常" : "禁用"), |
| | | categoryTxt = (dr["category"].ToString() == "1" ? "窗体类型" : "按钮类型"), |
| | | } |
| | | ); |
| | | } |
| | |
| | | public ReturnDto<int?> DeleteModel([FromBody] MenuAction model) |
| | | { |
| | | int rtnInt = (int)ReturnCode.Default; |
| | | int cont = 0; |
| | | try |
| | | { |
| | | //是否内置 |
| | | cont = int.Parse(DbHelperSQL.GetSingle("select count(1) from sys_MenuAction where guid='" + model.guid.ToString() + "' and [isSys]=1").ToString()); |
| | | if (cont > 0) |
| | | { |
| | | return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "删除失败,该条目为系统内置,不可删除!"); |
| | | } |
| | | cont = 0; |
| | | //是否有子菜单 |
| | | cont = int.Parse(DbHelperSQL.GetSingle("select count(1) from sys_MenuAction where upguid='" + model.guid.ToString() + "'").ToString()); |
| | | if (cont > 0) |
| | | { |
| | | return ReturnDto<int>.QuickReturn(default(int?), ReturnCode.Exception, "删除失败,该条目下面有子菜单,不可删除!"); |
| | | } |
| | | rtnInt = DbHelperSQL.ExecuteSql("delete from dbo.sys_MenuAction where guid='" + model.guid.ToString() + "'"); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | [RequestMethod(RequestMethods.POST)] |
| | | public ReturnDto<int?> EditModel([FromBody] MenuAction model) |
| | | { |
| | | string dddd= model.guid.ToString(); |
| | | string dddd = model.guid.ToString(); |
| | | Guid? guid = model.guid; |
| | | Guid? upGuid = model.upGuid; |
| | | string name = model.name; |
| | | string serialNumber = model.serialNumber; |
| | | string icon = model.icon; |
| | | int status = model.status; |
| | | string fromPath = model.fromPath; |
| | | string formPath = model.formPath; |
| | | int category = model.category; |
| | | int idx = model.idx; |
| | | int? rtnInt = (int)ReturnCode.Default; |
| | |
| | | if (guid != null) |
| | | { |
| | | strSql.Append(" update dbo.sys_MenuAction"); |
| | | strSql.Append(" set upGuid=@upGuid,name=@name,serialNumber=@serialNumber,icon=@icon,status=@status,fromPath=@fromPath,category=@category,idx=@idx"); |
| | | strSql.Append(" set upGuid=@upGuid,name=@name,icon=@icon,status=@status,formPath=@formPath,category=@category,idx=@idx"); |
| | | strSql.Append(" where guid='" + guid + "'"); |
| | | } |
| | | else |
| | | { |
| | | guid = Guid.NewGuid(); |
| | | strSql.Append("insert into dbo.sys_MenuAction("); |
| | | strSql.Append(" guid,upGuid,name,serialNumber,icon,status,fromPath,category,idx)"); |
| | | strSql.Append(" guid,upGuid,name,icon,status,formPath,category,idx)"); |
| | | strSql.Append(" values ("); |
| | | strSql.Append("'" + guid + "',@upGuid,@name,@serialNumber,@icon,@status,@fromPath,@category,@idx)"); |
| | | strSql.Append("'" + guid + "',@upGuid,@name,@icon,@status,@formPath,@category,@idx)"); |
| | | } |
| | | SqlParameter[] parameters = { |
| | | new SqlParameter("@upGuid", upGuid), |
| | | new SqlParameter("@name", name), |
| | | new SqlParameter("@serialNumber",serialNumber), |
| | | new SqlParameter("@icon",icon), |
| | | new SqlParameter("@status",status), |
| | | new SqlParameter("@fromPath",fromPath), |
| | | new SqlParameter("@formPath",formPath), |
| | | new SqlParameter("@category",category), |
| | | new SqlParameter("@idx",idx), |
| | | }; |
| | |
| | | rtnInt = (int)ReturnCode.Exception; |
| | | } |
| | | if (rtnInt > 0) |
| | | return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, "增加成功!"); |
| | | return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, "操作成功!"); |
| | | else |
| | | return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception, "增加失败,请重试!"); |
| | | } |
| | |
| | | /// <returns></returns> |
| | | [RequestMethod(RequestMethods.POST)] |
| | | [AllowAnonymous] |
| | | public ReturnDto<MenuAction> GetModel([FromBody] MenuAction model ) |
| | | public ReturnDto<MenuAction> GetModel([FromBody] MenuAction model) |
| | | { |
| | | MenuAction m = new MenuAction(); |
| | | System.Text.StringBuilder sbSql = new StringBuilder(); |
| | |
| | | m.guid = Guid.Parse(dr["guid"].ToString()); |
| | | m.upGuid = dr["upGuid"].ToString().Length > 0 ? Guid.Parse(dr["upGuid"].ToString()) : null; |
| | | m.name = dr["name"].ToString(); |
| | | m.serialNumber = dr["serialNumber"].ToString(); |
| | | m.icon = dr["icon"].ToString(); |
| | | m.status = int.Parse(dr["status"].ToString()); |
| | | m.fromPath = dr["fromPath"].ToString(); |
| | | m.formPath = dr["formPath"].ToString(); |
| | | m.idx = int.Parse(dr["idx"].ToString()); |
| | | m.category = int.Parse(dr["category"].ToString()); |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "读取成功!"); |
| | |
| | | upGuid = dr["upGuid"].ToString().Length > 0 ? Guid.Parse(dr["upGuid"].ToString()) : null, |
| | | name = dr["name"].ToString(), |
| | | icon = dr["icon"].ToString(), |
| | | fromPath = dr["fromPath"].ToString(), |
| | | formPath = dr["formPath"].ToString(), |
| | | category = int.Parse(dr["category"].ToString()), |
| | | } |
| | | ); |