public void PartnerEditTest1()
        {
            PartnerEntity partner = new PartnerEntity();
            partner.Naziv = "naziv partnera";
            partner.Oib = "12345678901";
            partner.Adresa = "partnerova adresa";
            partner.Posta = "10000";
            partner.Mjesto = "partnerovo mjesto";
            partner.Valuta = 30;
            partner.IsActive = true;

            partner.Save(_adapter, true, false);

            Dictionary<string, string> routeValues = new Dictionary<string, string>();
            routeValues.Add("partnerId", partner.PartnerId.ToString());

            string page = FetchPage("PartnerEdit", routeValues);
        }
		public static PartnerEntity FetchPartner(DataAccessAdapterBase adapter, PrefetchPath2 prefetchPath, long PartnerId)
		{
			PartnerEntity _PartnerEntity = new PartnerEntity(PartnerId);
			adapter.FetchEntity(_PartnerEntity, prefetchPath);
			return _PartnerEntity;
		}
		/// <summary> setups the sync logic for member _partner</summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		private void SetupSyncPartner(IEntityCore relatedEntity)
		{
			if(_partner!=relatedEntity)
			{
				DesetupSyncPartner(true, true);
				_partner = (PartnerEntity)relatedEntity;
				this.PerformSetupSyncRelatedEntity( _partner, new PropertyChangedEventHandler( OnPartnerPropertyChanged ), "Partner", NinjaSoftware.Enio.CoolJ.RelationClasses.StaticRacunGlavaRelations.PartnerEntityUsingPartnerIdStatic, true, new string[] {  } );
			}
		}
		/// <summary> Removes the sync logic for member _partner</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 DesetupSyncPartner(bool signalRelatedEntity, bool resetFKFields)
		{
			this.PerformDesetupSyncRelatedEntity( _partner, new PropertyChangedEventHandler( OnPartnerPropertyChanged ), "Partner", NinjaSoftware.Enio.CoolJ.RelationClasses.StaticRacunGlavaRelations.PartnerEntityUsingPartnerIdStatic, true, signalRelatedEntity, "RacunGlavaCollection", resetFKFields, new int[] { (int)RacunGlavaFieldIndex.PartnerId } );
			_partner = null;
		}
		protected RacunGlavaEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			if(SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				_racunStavkaCollection = (EntityCollection<RacunStavkaEntity>)info.GetValue("_racunStavkaCollection", typeof(EntityCollection<RacunStavkaEntity>));
				_partner = (PartnerEntity)info.GetValue("_partner", typeof(PartnerEntity));
				if(_partner!=null)
				{
					_partner.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_status = (StatusRoEntity)info.GetValue("_status", typeof(StatusRoEntity));
				if(_status!=null)
				{
					_status.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_tarifa = (TarifaEntity)info.GetValue("_tarifa", typeof(TarifaEntity));
				if(_tarifa!=null)
				{
					_tarifa.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
			}
			// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
			// __LLBLGENPRO_USER_CODE_REGION_END
		}
        private PartnerEntity FetchPartner(DataAccessAdapterBase adapter, long? partnerId)
        {
            PartnerEntity partner;

            if (partnerId.HasValue && 0 != partnerId.Value)
            {
                partner = PartnerEntity.FetchPartner(adapter, null, partnerId.Value);
            }
            else
            {
                partner = new PartnerEntity();
                partner.IsActive = true;
            }

            return partner;
        }