From 60665fe5913db357ea37f9f52a64b6ac0ce21911 Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期三, 14 八月 2024 14:18:26 +0800
Subject: [PATCH] 增加地图选择

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/03-mgr/XhsProjectMgrPage.cs |   36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/03-mgr/XhsProjectMgrPage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/03-mgr/XhsProjectMgrPage.cs
index eeddf2d..c0b9493 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/03-mgr/XhsProjectMgrPage.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/03-mgr/XhsProjectMgrPage.cs
@@ -1,4 +1,5 @@
-锘縰sing DevExpress.Utils;
+锘縰sing DevExpress.CodeParser;
+using DevExpress.Utils;
 using HStation.WinFrmUI.Xhs;
 
 namespace HStation.WinFrmUI
@@ -131,7 +132,7 @@
         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);
@@ -141,6 +142,16 @@
                     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;
@@ -154,12 +165,22 @@
             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;
@@ -183,15 +204,20 @@
             {
                 _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 鍩虹鎿嶄綔
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3