Beispiel #1
0
        public void Create(ZipEntity entity)
        {
            MySqlParameter[] parameters = new MySqlParameter[]
            {
                new MySqlParameter("@Id", MySqlDbType.Int32)
                {
                    Direction = ParameterDirection.Output
                },
                new MySqlParameter("@my_data", MySqlDbType.LongBlob)
                {
                    Value = entity.Data
                },
                new MySqlParameter("@my_before", MySqlDbType.Double)
                {
                    Value = entity.Before
                },
                new MySqlParameter("@my_after", MySqlDbType.Double)
                {
                    Value = entity.After
                },
            };

            MariaHelper.ExecuteNonQuery(
                DBConfig.ConnStr,
                CommandType.StoredProcedure,
                "usp_myimage_create",
                parameters);
        }
Beispiel #2
0
        public void MapMapsEntityZipIdToDomainZipId()
        {
            var zipEntity = new ZipEntity(3);

            ZipCode zipCode = _mapper.Map(zipEntity);

            Assert.AreEqual(zipEntity.ZipId, zipCode.Id);
        }
Beispiel #3
0
 /// <summary> setups the sync logic for member _zip</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncZip(IEntity2 relatedEntity)
 {
     if (_zip != relatedEntity)
     {
         DesetupSyncZip(true, true);
         _zip = (ZipEntity)relatedEntity;
         base.PerformSetupSyncRelatedEntity(_zip, new PropertyChangedEventHandler(OnZipPropertyChanged), "Zip", CityZipEntity.Relations.ZipEntityUsingZipId, true, new string[] {  });
     }
 }
Beispiel #4
0
 /// <summary> setups the sync logic for member _zip_</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncZip_(IEntity2 relatedEntity)
 {
     if (_zip_ != relatedEntity)
     {
         DesetupSyncZip_(true, true);
         _zip_ = (ZipEntity)relatedEntity;
         base.PerformSetupSyncRelatedEntity(_zip_, new PropertyChangedEventHandler(OnZip_PropertyChanged), "Zip_", ZipRadiusDistanceEntity.Relations.ZipEntityUsingSourceZipId, true, new string[] {  });
     }
 }
Beispiel #5
0
        public void MapSetsIsDaylightSavingsToFalseWhenNGiven()
        {
            var zipEntity = new ZipEntity {
                DayLightSaving = "N"
            };

            ZipCode zipCode = _mapper.Map(zipEntity);

            Assert.IsFalse(zipCode.IsInDaylightSavingsTime);
        }
Beispiel #6
0
        public void MapMapsEntityZipCodeToDomainZipCode()
        {
            var zipEntity = new ZipEntity {
                ZipCode = "12345"
            };

            ZipCode zipCode = _mapper.Map(zipEntity);

            Assert.AreEqual(zipEntity.ZipCode, zipCode.Zip, "Zips did not match.");
        }
Beispiel #7
0
        /// <summary> Initializes the class members</summary>
        protected virtual void InitClassMembers()
        {
            _city = null;
            _zip  = null;

            PerformDependencyInjection();

            // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
            // __LLBLGENPRO_USER_CODE_REGION_END
            OnInitClassMembersComplete();
        }
Beispiel #8
0
        public void MapSetsTimeZoneToNegatedValueOfEntityTimeZone()
        {
            const TimeZone expectedTimeZone = TimeZone.Eastern;
            var            zipEntity        = new ZipEntity {
                TimeZone = "5"
            };

            ZipCode zipCode = _mapper.Map(zipEntity);

            Assert.AreEqual(expectedTimeZone, zipCode.TimeZone);
        }
Beispiel #9
0
        public void MapMapsLatitudeLongitudeToDoublesInZipCodeObject()
        {
            const float expectedLatitude  = -23.23843f;
            const float expectedLongitude = 55.23843f;
            var         zipEntity         = new ZipEntity {
                Latitude  = expectedLatitude.ToString(),
                Longitude = expectedLongitude.ToString()
            };

            ZipCode zipCode = _mapper.Map(zipEntity);

            Assert.AreEqual(expectedLatitude, zipCode.Latitude, "Latitudes did not match.");
            Assert.AreEqual(expectedLongitude, zipCode.Longitude, "Longitudes did not match.");
        }
Beispiel #10
0
        protected CityZipEntity(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            if (SerializationHelper.Optimization != SerializationOptimization.Fast)
            {
                _city = (CityEntity)info.GetValue("_city", typeof(CityEntity));
                if (_city != null)
                {
                    _city.AfterSave += new EventHandler(OnEntityAfterSave);
                }
                _zip = (ZipEntity)info.GetValue("_zip", typeof(ZipEntity));
                if (_zip != null)
                {
                    _zip.AfterSave += new EventHandler(OnEntityAfterSave);
                }

                base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
            }

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
Beispiel #11
0
 /// <summary> Removes the sync logic for member _zip</summary>
 /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
 /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
 private void DesetupSyncZip(bool signalRelatedEntity, bool resetFKFields)
 {
     base.PerformDesetupSyncRelatedEntity(_zip, new PropertyChangedEventHandler(OnZipPropertyChanged), "Zip", CityZipEntity.Relations.ZipEntityUsingZipId, true, signalRelatedEntity, "CityZip", resetFKFields, new int[] { (int)CityZipFieldIndex.ZipId });
     _zip = null;
 }
Beispiel #12
0
 /// <summary>
 /// 加载压缩文件
 /// </summary>
 private void LoadZipFile()
 {
     _ZipEntity = new ZipEntity(this.FileName);
 }
Beispiel #13
0
 /// <summary> Removes the sync logic for member _zip</summary>
 /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
 /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
 private void DesetupSyncZip(bool signalRelatedEntity, bool resetFKFields)
 {
     base.PerformDesetupSyncRelatedEntity(_zip, new PropertyChangedEventHandler(OnZipPropertyChanged), "Zip", ZipRadiusDistanceEntity.Relations.ZipEntityUsingDestinationZipId, true, signalRelatedEntity, "ZipRadiusDistance", resetFKFields, new int[] { (int)ZipRadiusDistanceFieldIndex.DestinationZipId });
     _zip = null;
 }
Beispiel #14
0
 public void LoadFile()
 {
     this.zip = new ZipEntity(filename);
 }