Exemplo n.º 1
0
 public static System.Data.IDataReader PageDataLoadRolesUsersByUser(CodeFluent.Runtime.PageOptions pageOptions, ModelCodeFluent.Identity.User user)
 {
     if ((user == null))
     {
         return(null);
     }
     if ((user.Id.Equals(CodeFluentPersistence.DefaultGuidValue) == true))
     {
         CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "user", "ModelCodeFluent.Identity.User");
     }
     CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(ModelCodeFluent.Constants.ModelCodeFluentStoreName).Persistence;
     persistence.CreateStoredProcedureCommand(null, "Role", "LoadRolesUsersByUser");
     persistence.AddParameter("@UserId", user.Id, CodeFluentPersistence.DefaultGuidValue);
     if ((pageOptions != null))
     {
         System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator();
         bool b;
         int  index = 0;
         for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
         {
             CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current));
             persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name);
             persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction)));
             index = (index + 1);
         }
     }
     System.Data.IDataReader reader = CodeFluentContext.Get(ModelCodeFluent.Constants.ModelCodeFluentStoreName).Persistence.ExecuteReader();
     return(reader);
 }
 public static System.Data.IDataReader PageDataLoadByContactSource(CodeFluent.Runtime.PageOptions pageOptions, SoftFluent.SqlServerInMemory.ContactSource contactSource)
 {
     if ((contactSource == null))
     {
         return(null);
     }
     if ((contactSource.Id == -1))
     {
         CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "contactSource", "SoftFluent.SqlServerInMemory.ContactSource");
     }
     CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.SqlServerInMemory.Constants.SoftFluent_SqlServerInMemoryStoreName).Persistence;
     persistence.CreateStoredProcedureCommand(null, "Customer", "LoadByContactSource");
     persistence.AddParameter("@ContactSourceId", contactSource.Id, ((int)(-1)));
     if ((pageOptions != null))
     {
         System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator();
         bool b;
         int  index = 0;
         for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
         {
             CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current));
             persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name);
             persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction)));
             index = (index + 1);
         }
     }
     System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.SqlServerInMemory.Constants.SoftFluent_SqlServerInMemoryStoreName).Persistence.ExecuteReader();
     return(reader);
 }
 public static System.Data.IDataReader PageDataLoadUsersRolesByRole(CodeFluent.Runtime.PageOptions pageOptions, SoftFluent.Samples.AspNetIdentity2.Role role)
 {
     if ((role == null))
     {
         return(null);
     }
     if ((role.Id.Equals(CodeFluentPersistence.DefaultGuidValue) == true))
     {
         CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "role", "SoftFluent.Samples.AspNetIdentity2.Role");
     }
     CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.AspNetIdentity2.Constants.SoftFluent_Samples_AspNetIdentity2StoreName).Persistence;
     persistence.CreateStoredProcedureCommand(null, "User", "LoadUsersRolesByRole");
     persistence.AddParameter("@RoleId", role.Id, CodeFluentPersistence.DefaultGuidValue);
     if ((pageOptions != null))
     {
         System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator();
         bool b;
         int  index = 0;
         for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
         {
             CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current));
             persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name);
             persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction)));
             index = (index + 1);
         }
     }
     System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.Samples.AspNetIdentity2.Constants.SoftFluent_Samples_AspNetIdentity2StoreName).Persistence.ExecuteReader();
     return(reader);
 }
 public static System.Data.IDataReader PageDataLoadByUser(CodeFluent.Runtime.PageOptions pageOptions, SoftFluent.Samples.AspNetIdentity1.User user)
 {
     if ((user == null))
     {
         return(null);
     }
     if ((user.Id == default(string)))
     {
         CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "user", "SoftFluent.Samples.AspNetIdentity1.User");
     }
     CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.AspNetIdentity1.Constants.SoftFluent_Samples_AspNetIdentity1StoreName).Persistence;
     persistence.CreateStoredProcedureCommand(null, "ExternalLogin", "LoadByUser");
     persistence.AddParameter("@UserId", user.Id, default(string));
     if ((pageOptions != null))
     {
         System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator();
         bool b;
         int  index = 0;
         for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
         {
             CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current));
             persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name);
             persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction)));
             index = (index + 1);
         }
     }
     System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.Samples.AspNetIdentity1.Constants.SoftFluent_Samples_AspNetIdentity1StoreName).Persistence.ExecuteReader();
     return(reader);
 }
 public static System.Data.IDataReader PageDataLoadSpacesSupportBySupport(CodeFluent.Runtime.PageOptions pageOptions, SoftFluent.Json.NET.Support support)
 {
     if ((support == null))
     {
         return(null);
     }
     if ((support.Id == -1))
     {
         CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "support", "SoftFluent.Json.NET.Support");
     }
     CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Json.NET.Constants.SoftFluent_Json_NETStoreName).Persistence;
     persistence.CreateStoredProcedureCommand(null, "Space", "LoadSpacesSupportBySupport");
     persistence.AddParameter("@SupportId", support.Id, ((int)(-1)));
     if ((pageOptions != null))
     {
         System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator();
         bool b;
         int  index = 0;
         for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
         {
             CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current));
             persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name);
             persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction)));
             index = (index + 1);
         }
     }
     System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.Json.NET.Constants.SoftFluent_Json_NETStoreName).Persistence.ExecuteReader();
     return(reader);
 }
 public static System.Data.IDataReader PageDataLoadByCardNumber(CodeFluent.Runtime.PageOptions pageOptions, string cardNumber)
 {
     if ((cardNumber == default(string)))
     {
         throw new System.ArgumentNullException("cardNumber");
     }
     CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.EncryptAspect.Constants.SoftFluent_Samples_EncryptAspectStoreName).Persistence;
     persistence.CreateStoredProcedureCommand(null, "Customer", "LoadByCardNumber");
     persistence.AddParameter("@CardNumber", cardNumber, default(string));
     persistence.AddParameter("@PassPhrase", SoftFluent.Samples.EncryptAspect.PassPhrase.GetPassPhrase(), default(string));
     if ((pageOptions != null))
     {
         System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator();
         bool b;
         int  index = 0;
         for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
         {
             CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current));
             persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name);
             persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction)));
             index = (index + 1);
         }
     }
     System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.Samples.EncryptAspect.Constants.SoftFluent_Samples_EncryptAspectStoreName).Persistence.ExecuteReader();
     return(reader);
 }
 public static System.Data.IDataReader PageDataLoadAll(CodeFluent.Runtime.PageOptions pageOptions)
 {
     CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.SqlServerInMemory.Constants.SoftFluent_SqlServerInMemoryStoreName).Persistence;
     persistence.CreateStoredProcedureCommand(null, "Customer", "LoadAll");
     if ((pageOptions != null))
     {
         System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator();
         bool b;
         int  index = 0;
         for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
         {
             CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current));
             persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name);
             persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction)));
             index = (index + 1);
         }
     }
     System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.SqlServerInMemory.Constants.SoftFluent_SqlServerInMemoryStoreName).Persistence.ExecuteReader();
     return(reader);
 }
Exemplo n.º 8
0
 public static System.Data.IDataReader PageDataLoadAll(CodeFluent.Runtime.PageOptions pageOptions)
 {
     CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.RedisCache.Constants.SoftFluent_Samples_RedisCacheStoreName).Persistence;
     persistence.CreateStoredProcedureCommand(null, "Category", "LoadAll");
     persistence.AddParameter("@Lcid", System.Threading.Thread.CurrentThread.CurrentUICulture.LCID, ((int)(1033)));
     if ((pageOptions != null))
     {
         System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator();
         bool b;
         int  index = 0;
         for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
         {
             CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current));
             persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name);
             persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction)));
             index = (index + 1);
         }
     }
     System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.Samples.RedisCache.Constants.SoftFluent_Samples_RedisCacheStoreName).Persistence.ExecuteReader();
     return(reader);
 }
Exemplo n.º 9
0
 public static System.Data.IDataReader PageDataSearch(CodeFluent.Runtime.PageOptions pageOptions, int id, string email, string firstName, string lastName)
 {
     CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(ContactManager.Constants.ContactManagerStoreName).Persistence;
     persistence.CreateStoredProcedureCommand(null, "User", "Search");
     persistence.AddParameter("@Id", id, ((int)(-1)));
     persistence.AddParameter("@Email", email, default(string));
     persistence.AddParameter("@FirstName", firstName, default(string));
     persistence.AddParameter("@LastName", lastName, default(string));
     if ((pageOptions != null))
     {
         System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator();
         bool b;
         int  index = 0;
         for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
         {
             CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current));
             persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name);
             persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction)));
             index = (index + 1);
         }
     }
     System.Data.IDataReader reader = CodeFluentContext.Get(ContactManager.Constants.ContactManagerStoreName).Persistence.ExecuteReader();
     return(reader);
 }