| | |
| | | using DevExpress.Utils; |
| | | using DevExpress.CodeParser; |
| | | using DevExpress.Utils; |
| | | using HStation.WinFrmUI.Xhs; |
| | | |
| | | namespace HStation.WinFrmUI |
| | |
| | | private void barBtnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var dlg = new AddProjectDlg(); |
| | | dlg.ReloadDataEvent += async (rhs) => |
| | | dlg.ReloadDataEvent += async (rhs, mapinfo) => |
| | | { |
| | | var bll = new BLL.XhsProjectExtensions(); |
| | | var id = await bll.Insert(rhs); |
| | |
| | | var vmo = await _bll.GetByID(id); |
| | | _allProjectList.Add(new XhsProjectMgrViewModel(vmo)); |
| | | this.xhsProjectMgrViewModelBindingSource.ResetBindings(false); |
| | | if (mapinfo != null) |
| | | { |
| | | mapinfo.ObjectID = id; |
| | | mapinfo.ObjectName = rhs.Name; |
| | | var mapinfoid = await new Yw.BLL.MapInfo().Insert(mapinfo); |
| | | if (mapinfoid < 0) |
| | | { |
| | | TipFormHelper.ShowError("地图信息添加错误"); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | |
| | | var currentVm = this.GetCurrentViewModel(); |
| | | var dlg = new EditProjectDlg(); |
| | | dlg.SetBindingData(currentVm.ID); |
| | | dlg.ReloadDataEvent += async (rhs) => |
| | | dlg.ReloadDataEvent += async (rhs, mapinfo) => |
| | | { |
| | | if (await _bll.Update(rhs)) |
| | | { |
| | | currentVm.Reset(rhs); |
| | | this.xhsProjectMgrViewModelBindingSource.ResetBindings(false); |
| | | if (mapinfo != null) |
| | | { |
| | | // mapinfo.ObjectID = id; |
| | | mapinfo.ObjectName = rhs.Name; |
| | | var bol = await new Yw.BLL.MapInfo().Update(mapinfo); |
| | | if (!bol) |
| | | { |
| | | TipFormHelper.ShowError("地图信息添加错误"); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | |
| | | { |
| | | _allProjectList.Remove(currentVm); |
| | | this.xhsProjectMgrViewModelBindingSource.ResetBindings(false); |
| | | MessageBoxHelper.ShowSuccess($"删除成功!"); |
| | | TipFormHelper.ShowSucceed("删除成功!"); |
| | | } |
| | | else |
| | | { |
| | | MessageBoxHelper.ShowError($"删除失败!"); |
| | | TipFormHelper.ShowSucceed("删除失败!"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | //详细信息 |
| | | private void barBtnInfo_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | } |
| | | |
| | | #endregion 基础操作 |
| | | } |
| | | } |