Ejemplo n.º 1
0
 private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
 {
     if (treeList1.FocusedColumn == null)
     {
         return;
     }
     if (treeList1.FocusedColumn.Caption != "操作")
     {
         String id          = Convert.ToString(treeList1.FocusedNode.GetValue("id"));
         var    selectedRow = new MenuEntity();
         if (id == null)
         {
             return;
         }
         selectedRow.id = id;
         var form = new MenuEdit();
         form.menu = selectedRow;
         form.Text = "菜单修改";
         if (form.ShowDialog() == DialogResult.OK)
         {
             Thread.Sleep(300);
             cmd.ShowOpaqueLayer();
             SearchData();
             MessageBoxUtils.Hint("修改菜单成功!", MainForm);
         }
     }
 }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var edit = new MenuEdit();

            if (edit.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(300);
                cmd.ShowOpaqueLayer();
                SearchData();
                MessageBoxUtils.Hint("保存成功!", MainForm);
            }
        }
Ejemplo n.º 3
0
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            var selectedRow = new MenuEntity();

            selectedRow.parentId = Convert.ToString(treeList1.FocusedNode.GetValue("id"));
            var form = new MenuEdit();

            form.menu = selectedRow;
            if (form.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(300);
                cmd.ShowOpaqueLayer();
                SearchData();
                MessageBoxUtils.Hint("添加菜单成功!", MainForm);
            }
        }
Ejemplo n.º 4
0
        private void btnUp_Click(object sender, EventArgs e)
        {
            String id          = Convert.ToString(treeList1.FocusedNode.GetValue("id"));
            var    selectedRow = new MenuEntity();

            if (id == null)
            {
                return;
            }
            selectedRow.id = id;
            var form = new MenuEdit();

            form.menu = selectedRow;
            form.Text = "菜单修改";
            if (form.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(300);
                cmd.ShowOpaqueLayer();
                SearchData();
                MessageBoxUtils.Hint("修改菜单成功!", MainForm);
            }
        }