WJC
2020-03-23 bba578c2f0acf2eca747edcb69426771e0cadd32
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
@@ -205,6 +205,12 @@
        /// <param name="mode">是否显示错误</param>
        public async Task<bool> AddNewGateway(ZbGateway zbGateway, ShowErrorMode mode)
        {
            //设置网关的经纬度
            bool falge = this.SetGatewaySite(zbGateway, Common.Config.Instance.Home.Longitude, Common.Config.Instance.Home.Latitude, ShowErrorMode.NO);
            if (falge == false)
            {
                return falge;
            }
            //执行添加网关到内存
            var result = await this.DoAddGatewayToMemory(zbGateway, mode);
            //前的网关绑定在了当前账号下的不同住宅里面
@@ -438,7 +444,7 @@
                return -1;
            }
            //设置网关的经纬度
            bool falge = this.SetGatewaySite(zbGateway, Common.Config.Instance.Home.Longitude, Common.Config.Instance.Home.Latitude);
            bool falge = this.SetGatewaySite(zbGateway, Common.Config.Instance.Home.Longitude, Common.Config.Instance.Home.Latitude, ShowErrorMode.YES);
            if (falge == false)
            {
                return -1;
@@ -2209,15 +2215,19 @@
        /// <param name="gateway">网关对象</param>
        /// <param name="Longitude">经度</param>
        /// <param name="Latitude">维度</param>
        /// <param name="mode">显示错误</param>
        /// <returns></returns>
        public bool SetGatewaySite(ZbGateway gateway, double Longitude, double Latitude)
        public bool SetGatewaySite(ZbGateway gateway, double Longitude, double Latitude, ShowErrorMode mode)
        {
            ZbGateway realWay = null;
            if (this.GetRealGateway(ref realWay, gateway) == false)
            {
                if (mode == ShowErrorMode.YES)
                {
                //错误:网关对象丢失
                string msg = Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg);
                this.ShowTipMsg(msg);
                }
                return false;
            }
@@ -2262,6 +2272,8 @@
            realWay.Actions -= action;
            if (result != 0)
            {
                if (mode == ShowErrorMode.YES)
                {
                //设置网关经纬度失败
                string msg = Language.StringByID(R.MyInternationalizationString.uSetGatewaySiteFail);
                if (result == -1)
@@ -2269,6 +2281,7 @@
                    msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, null, "回复超时");
                }
                this.ShowTipMsg(msg);
                }
                return false;
            }