黄学彪
2019-12-12 7e863a33397f317ffc3ffd9288496d0e4f16aa66
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs
@@ -42,6 +42,11 @@
            row1.AddBottomLine();
            row1.ButtonClickEvent += (sender, e) =>
            {
                //检测住宅经纬度
                if (this.CheckResidencePoint() == false)
                {
                    return;
                }
                var form = new WiredGatewayDirectionForm();
                form.AddForm();
            };
@@ -56,6 +61,11 @@
            row2.AddRightArrow();
            row2.ButtonClickEvent += (sender, e) =>
            {
                //检测住宅经纬度
                if (this.CheckResidencePoint() == false)
                {
                    return;
                }
                var menuContr = new BottomMenuSelectForm();
                menuContr.AddForm(2);
                //UDP模式(推荐)
@@ -72,5 +82,26 @@
                });
            };
        }
        /// <summary>
        /// 检测住宅经纬度
        /// </summary>
        /// <returns></returns>
        private bool CheckResidencePoint()
        {
            if (Common.Config.Instance.Home.Latitude == 0 && Common.Config.Instance.Home.Longitude == 0)
            {
                //请前往住宅管理{0}设置住宅的地理位置
                string msg = Language.StringByID(R.MyInternationalizationString.uGotoResidenceAndSetLocation).Replace("{0}", "\r\n");
                this.ShowMassage(ShowMsgType.Confirm, msg, () =>
                {
                    var form = new Residence.ResidenceManagementForm();
                    form.AddForm(false);
                }, Language.StringByID(R.MyInternationalizationString.uGotoSettion));
                return false;
            }
            return true;
        }
    }
}