duheng
2024-09-26 f04e6ed843d66c22e08132ca23d2193d6800905c
WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/04-dlg/EditProjectDlg.cs
@@ -1,4 +1,6 @@
namespace HStation.WinFrmUI.Xhs
using HStation.Vmo;
namespace HStation.WinFrmUI.Xhs
{
    public partial class EditProjectDlg : DevExpress.XtraEditors.XtraForm
    {
@@ -15,13 +17,13 @@
            await this.mapSetSimpleMarkerContainer1.InitialContainer();
        }
        public event Func<Vmo.Xhs.XhsProjectExtensions, Yw.Vmo.Map.MapInfo, Task<bool>> ReloadDataEvent;
        public event Func<XhsProjectExtensionsVmo, Yw.Vmo.MapInfoVmo, Task<bool>> ReloadDataEvent;
        private Vmo.Xhs.XhsProjectExtensions _xhsProjectExtensions;
        private XhsProjectExtensionsVmo _xhsProjectExtensions;
        private Yw.Model.Map.Marker _maker = null; //地图点信息
        private Yw.Vmo.Map.MapInfo _mapinfo = null; //地图信息
        private Yw.Vmo.MapInfoVmo _mapinfo = null; //地图信息
        public async void SetBindingData(long ID)
        {
@@ -32,12 +34,12 @@
            this.TextProjectName.Text = _xhsProjectExtensions.Name;
            this.TextCustomerName.Text = _xhsProjectExtensions.Customer;
            this.TextDescription.Text = _xhsProjectExtensions.Description;
            this.TextAddress.Text = _xhsProjectExtensions.Address;
            this.TextTagName.Text = _xhsProjectExtensions.TagName;
            var mapinfo = await new Yw.BLL.MapInfo().Get(HStation.Xhs.DataType.XhsProject, ID, Yw.Map.Purpose.Location, Yw.Map.Kind.Gaodei);
            var mapinfo = await new Yw.BLL.MapInfo().Get(HStation.Xhs.DataType.XhsProject, ID, Yw.Map.Kind.Gaodei, Yw.Map.Purpose.Location);
            if (mapinfo != null)
            {
                _mapinfo = mapinfo;
                this.TextAddress.Text = Yw.Model.Map.Marker.ToModel(_mapinfo.Position).Address;
            }
        }
@@ -84,9 +86,9 @@
            _xhsProjectExtensions.Description = this.TextDescription.Text.Trim();
            _xhsProjectExtensions.Name = this.TextProjectName.Text.Trim();
            _xhsProjectExtensions.TagName = this.TextTagName.Text.Trim();
            _xhsProjectExtensions.SiteList = new List<Vmo.Xhs.XhsProjectSite>
            _xhsProjectExtensions.SiteList = new List<XhsProjectSiteVmo>
            {
                new Vmo.Xhs.XhsProjectSite
                new XhsProjectSiteVmo
                {
                    Name=this.TextProjectName.Text,
                    Description=this.TextDescription.Text,
@@ -94,11 +96,6 @@
            };
            if (_maker != null)
            {
                _mapinfo = new Yw.Vmo.Map.MapInfo();
                _mapinfo.ObjectType = HStation.Xhs.DataType.XhsProject;
                _mapinfo.Purpose = Yw.Map.Purpose.Location;
                _mapinfo.Kind = Yw.Map.Kind.Gaodei;
                _mapinfo.Shape = Yw.Map.Shape.Marker;
                _mapinfo.Position = _maker.ToJson();
            }
            if (await this.ReloadDataEvent.Invoke(_xhsProjectExtensions, _mapinfo))