| | |
| | | using DevExpress.XtraEditors; |
| | | 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 HStation.WinFrmUI.Auth |
| | | namespace HStation.WinFrmUI.Auth |
| | | { |
| | | public partial class UpdataMenuDlg : DevExpress.XtraEditors.XtraForm |
| | | { |
| | |
| | | { |
| | | InitializeComponent(); |
| | | } |
| | | string error; |
| | | Yw.Vmo.ProjectMenu _projectMenu = new Yw.Vmo.ProjectMenu(); |
| | | |
| | | private string error; |
| | | private Yw.Vmo.ProjectMenu _projectMenu = new Yw.Vmo.ProjectMenu(); |
| | | |
| | | public async void SetMenuData(Yw.Vmo.ProjectMenu projectMenu) |
| | | { |
| | | error = ""; |
| | | _projectMenu = projectMenu; |
| | | error =await menuInfoCtrl.SetProjectMenu(projectMenu); |
| | | error = await menuInfoCtrl.SetProjectMenu(projectMenu); |
| | | if (!string.IsNullOrEmpty(error)) |
| | | { |
| | | MessageBox.Show(error); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | //确定 |
| | | private async void simpleButtonOK_Click(object sender, EventArgs e) |
| | | { |
| | | error = ""; |
| | | Yw.BLL.ProjectMenu sever = new Yw.BLL.ProjectMenu(); |
| | | var AllMenu = sever.GetByProjectID(0); |
| | | var menuData = menuInfoCtrl.OperateData(_projectMenu,out error); |
| | | var menuData = menuInfoCtrl.OperateData(_projectMenu, out error); |
| | | if (!string.IsNullOrEmpty(error)) |
| | | { |
| | | MessageBox.Show(error); |
| | |
| | | prentid.ParentID = menuData.ParentID; |
| | | prentid.ID = menuData.ID; |
| | | prentid.SortCode = menuData.SortCode; |
| | | if (!sever.UpdateTreeSortCode(prentid)) |
| | | { |
| | | MessageBox.Show("节点修改修改失败!"); |
| | | return; |
| | | } |
| | | |
| | | if(!await sever.Update(menuData)) |
| | | { |
| | | MessageBox.Show("修改失败!"); |
| | | return; |
| | | } |
| | | /* if (!sever.UpdateTreeSortCode(prentid)) |
| | | { |
| | | MessageBox.Show("节点修改修改失败!"); |
| | | return; |
| | | } |
| | | |
| | | if (!await sever.Update(menuData)) |
| | | { |
| | | MessageBox.Show("修改失败!"); |
| | | return; |
| | | }*/ |
| | | MessageBox.Show("修改成功!"); |
| | | this.DialogResult = DialogResult.OK; |
| | | this.Close(); |
| | | } |
| | | |
| | | //取消 |
| | | private void simpleButtonCancel_Click(object sender, EventArgs e) |
| | | { |