Exemple #1
0
        internal void SaveProductsRelations()
        {
            if ((this._products == null))
            {
                return;
            }
            System.Collections.IEnumerator enumerator = ((CodeFluent.Runtime.ICodeFluentSet)(this._products)).Relations.GetEnumerator();
            bool b;

            for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
            {
                System.Collections.DictionaryEntry        entry        = ((System.Collections.DictionaryEntry)(enumerator.Current));
                SoftFluent.Json.NET.Product               product      = ((SoftFluent.Json.NET.Product)(entry.Key));
                CodeFluent.Runtime.CodeFluentRelationType relationType = ((CodeFluent.Runtime.CodeFluentRelationType)(entry.Value));
                if (((relationType == CodeFluent.Runtime.CodeFluentRelationType.Added) &&
                     ((product.EntityState == CodeFluent.Runtime.CodeFluentEntityState.ToBeUnlinked)
                      == false)))
                {
                    CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Json.NET.Constants.SoftFluent_Json_NETStoreName).Persistence;
                    persistence.CreateStoredProcedureCommand(null, "Publication", "SaveProductPublications");
                    persistence.AddParameter("@Product_Id", product.Id, ((int)(-1)));
                    persistence.AddParameter("@Publication_Id", this.Id, ((int)(-1)));
                    persistence.ExecuteNonQuery();
                }
                else
                {
                    CodeFluent.Runtime.CodeFluentPersistence persistence1 = CodeFluentContext.Get(SoftFluent.Json.NET.Constants.SoftFluent_Json_NETStoreName).Persistence;
                    persistence1.CreateStoredProcedureCommand(null, "Publication", "DeleteProductPublications");
                    persistence1.AddParameter("@Product_Id", product.Id, ((int)(-1)));
                    persistence1.AddParameter("@Publication_Id", this.Id, ((int)(-1)));
                    persistence1.ExecuteNonQuery();
                }
                if ((product.EntityState == CodeFluent.Runtime.CodeFluentEntityState.ToBeUnlinked))
                {
                    product.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged;
                }
            }
            ((CodeFluent.Runtime.ICodeFluentSet)(this._products)).Relations.Clear();
        }
Exemple #2
0
        internal void SaveUsersRelations()
        {
            if ((this._users == null))
            {
                return;
            }
            System.Collections.IEnumerator enumerator = ((CodeFluent.Runtime.ICodeFluentSet)(this._users)).Relations.GetEnumerator();
            bool b;

            for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
            {
                System.Collections.DictionaryEntry entry = ((System.Collections.DictionaryEntry)(enumerator.Current));
                SoftFluent.Samples.Thinktecture.IdentityServer.User user         = ((SoftFluent.Samples.Thinktecture.IdentityServer.User)(entry.Key));
                CodeFluent.Runtime.CodeFluentRelationType           relationType = ((CodeFluent.Runtime.CodeFluentRelationType)(entry.Value));
                if (((relationType == CodeFluent.Runtime.CodeFluentRelationType.Added) &&
                     ((user.EntityState == CodeFluent.Runtime.CodeFluentEntityState.ToBeUnlinked)
                      == false)))
                {
                    CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.Thinktecture.IdentityServer.Constants.SoftFluent_Samples_Thinktecture_IdentityServerStoreName).Persistence;
                    persistence.CreateStoredProcedureCommand(null, "User", "SaveRoleUsers");
                    persistence.AddParameter("@Role_Id", this.Id, CodeFluentPersistence.DefaultGuidValue);
                    persistence.AddParameter("@User_Id", user.Id, CodeFluentPersistence.DefaultGuidValue);
                    persistence.ExecuteNonQuery();
                }
                else
                {
                    CodeFluent.Runtime.CodeFluentPersistence persistence1 = CodeFluentContext.Get(SoftFluent.Samples.Thinktecture.IdentityServer.Constants.SoftFluent_Samples_Thinktecture_IdentityServerStoreName).Persistence;
                    persistence1.CreateStoredProcedureCommand(null, "User", "DeleteRoleUsers");
                    persistence1.AddParameter("@Role_Id", this.Id, CodeFluentPersistence.DefaultGuidValue);
                    persistence1.AddParameter("@User_Id", user.Id, CodeFluentPersistence.DefaultGuidValue);
                    persistence1.ExecuteNonQuery();
                }
                if ((user.EntityState == CodeFluent.Runtime.CodeFluentEntityState.ToBeUnlinked))
                {
                    user.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged;
                }
            }
            ((CodeFluent.Runtime.ICodeFluentSet)(this._users)).Relations.Clear();
        }
Exemple #3
0
 protected virtual void Relate(ModelCodeFluent.Vehicle item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
Exemple #4
0
 protected virtual void Relate(ContactManager.User item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
Exemple #5
0
 protected virtual void Relate(SoftFluent.Json.NET.Support item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
 protected virtual void Relate(SoftFluent.Samples.StoreEnumAsText.Sample item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
 protected virtual void Relate(ContactManager.Proxy.Address item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ServiceModel.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
Exemple #8
0
 protected virtual void Relate(SoftFluent.Samples.SignalR.Proxy.Customer item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ServiceModel.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
Exemple #9
0
 protected virtual void Relate(SoftFluent.Samples.RedisCache.Category item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
 protected virtual void Relate(SoftFluent.Samples.ComponentOne.Contact item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
Exemple #11
0
 protected virtual void Relate(SoftFluent.Samples.Thinktecture.IdentityServer.User item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
Exemple #12
0
 protected virtual void Relate(SoftFluent.Samples.GED.Security.Role item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
Exemple #13
0
 protected virtual void Relate(ModelCodeFluent.Identity.UserLogin item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
Exemple #14
0
 protected virtual void Relate(Sample.Customer item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
 protected virtual void Relate(DigitalPicnik.List item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
 protected virtual void Relate(SoftFluent.Samples.AspNetIdentity2.UserClaim item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
 protected virtual void Relate(SoftFluent.SqlServerInMemory.Customer item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }
 protected virtual void Relate(SoftFluent.Samples.ReadOnSave.Order item, CodeFluent.Runtime.CodeFluentRelationType relationType)
 {
     ((CodeFluent.Runtime.ICodeFluentSet)(this)).Relations[item] = relationType;
 }