private VMapElementModelByBind ConvertEMapMarkForBind(EMapMark entity) { return new VMapElementModelByBind() { RecordID = entity.RecordID.ToString(), Name = entity.Name, Description = entity.Description, MarkType = VMapElementModelByBind.Mark_Type, Lat = entity.Latitude, Lon = entity.Longitude, Points = entity.Latlonencode, CreateDate = entity.CreateTime, Zoom = entity.Zoom }; }
public VMarkElement AddMarker(VMarkElement model) { EMapMark entity = new EMapMark(); entity.RecordID = Guid.NewGuid(); entity.Description = model.Description; entity.Latitude = model.Lat; entity.Longitude = model.Lon; entity.Latlonencode = model.EncodeLatLon; entity.Name = model.Name; entity.Type = model.Type; entity.Zoom = model.Zoom; entity.UserCode = model.UserCode; entity.TenantCode = model.TenantCode; entity.CreateTime = DateTime.Now; bool isExists = DACFacade.Gps.MapMarkDAC.Select(model.Name, model.TenantCode) == null ? false : true; if (isExists) { model.Name = string.Empty; model.Description = string.Empty; model.Msg = "exist"; return model; } if (model.MapType == EnumMapType.GoogleCN) { LatLonModel.ConvertToRealLatLon<EMapMark>(entity, model.MapType); } int result = DACFacade.Gps.MapMarkDAC.Insert(null, entity); model.RecordID = entity.RecordID.ToString(); return model; }
private VMarkElement ConvertMarkElementEntityToViewModel(EMapMark entity, EnumMapType mapType) { VMarkElement returnValue = new VMarkElement(); returnValue.RecordID = entity.RecordID.ToString(); returnValue.Name = entity.Name; returnValue.TenantCode = entity.TenantCode; returnValue.UserCode = entity.UserCode; returnValue.Description = entity.Description; returnValue.Type = entity.Type; returnValue.Zoom = entity.Zoom; returnValue.Lon = entity.Longitude; returnValue.Lat = entity.Latitude; returnValue.EncodeLatLon = new PES.GPSExpressEdition.MapService.MapSearchService.MapService().Encode(returnValue.Lat.ToString(), returnValue.Lon.ToString()); return returnValue; }