Exemple #1
0
 public void SaveIOSPhoneInfo(PhoneModel model)
 {
     BaiduMapService ms = new BaiduMapService();
     var baiduLatLon = ms.MarToLatLon(new LatLon { Longitude = Convert.ToDouble(model.lon), Latitude = Convert.ToDouble(model.lat) });
     model.lon = Convert.ToDecimal(baiduLatLon.Longitude);
     model.lat = Convert.ToDecimal(baiduLatLon.Latitude);
     SavePhoneInfo(model);
 }
Exemple #2
0
        public void SavePhoneInfo(PhoneModel model)
        {
            var _curInfo = DACFacade.Movo.MobileDAC.GetCurrentByIMEISimNum(model.imei, model.tel);
            if (_curInfo != null)
            {
                _curInfo.OrgID = model.orgid;
                _curInfo.Lng = model.lon;
                _curInfo.Lat = model.lat;
                _curInfo.ReportTime = model.repottime;
                _curInfo.AddrInfo = model.addr;
                _curInfo.StateFlag = model.state;
                DACFacade.Movo.MobileDAC.UpdCurrent(null, _curInfo);
            }
            else
            {
                _curInfo = new Entity.MobileWS.EMobileCurrent();
                _curInfo.OrgID = model.orgid;
                _curInfo.IMEI = model.imei;
                _curInfo.SimNum = model.tel;
                _curInfo.UserName = model.name;
                _curInfo.CreateTime = DateTime.Now;
                _curInfo.Lng = model.lon;
                _curInfo.Lat = model.lat;
                _curInfo.ReportTime = model.repottime;
                _curInfo.AddrInfo = model.addr;
                _curInfo.StateFlag = model.state;
                DACFacade.Movo.MobileDAC.InsCurrent(null, _curInfo);
            }

            if (_curInfo.PhoneID < 1)
                _curInfo = DACFacade.Movo.MobileDAC.GetCurrentByIMEISimNum(model.imei, model.tel);

            DACFacade.Movo.MobileDAC.InsertHistory(null, new Entity.MobileWS.EMobileHistory
            {
                PhoneID = _curInfo.PhoneID,
                Lng = model.lon,
                Lat = model.lat,
                ReportTime = model.repottime,
                AddrInfo = model.addr,
                StateFlag = model.state
            });
        }