Пример #1
0
 /// <summary>
 /// Gets all the storage types.
 /// </summary>
 /// <returns>All storage types.</returns>
 public virtual IEnumerable <IStorageType> StorageTypeGetAll()
 {
     try
     {
         MySqlCommand command = new SystemDataCommandBuilder("SELECT StorageTypeIdentifier,SortOrder,Temperature,TemperatureRangeStartValue,TemperatureRangeEndValue,Creatable,Editable,Deletable FROM StorageTypes ORDER BY SortOrder").Build();
         return(DataProvider.GetCollection <StorageTypeProxy>(command));
     }
     catch (IntranetRepositoryException)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new IntranetRepositoryException(Resource.GetExceptionMessage(ExceptionMessage.RepositoryError, MethodBase.GetCurrentMethod().Name, ex.Message), ex);
     }
 }
Пример #2
0
 /// <summary>
 /// Gets all the translation information which can be used for translation.
 /// </summary>
 /// <returns>All the translation information which can be used for translation.</returns>
 public virtual IEnumerable <ITranslationInfo> TranslationInfoGetAll()
 {
     try
     {
         MySqlCommand command = new SystemDataCommandBuilder("SELECT TranslationInfoIdentifier,CultureName FROM TranslationInfos ORDER BY CultureName").Build();
         return(DataProvider.GetCollection <TranslationInfoProxy>(command));
     }
     catch (IntranetRepositoryException)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new IntranetRepositoryException(Resource.GetExceptionMessage(ExceptionMessage.RepositoryError, MethodBase.GetCurrentMethod().Name, ex.Message), ex);
     }
 }
Пример #3
0
 /// <summary>
 /// Gets all the static texts.
 /// </summary>
 /// <returns>All the static texts.</returns>
 public virtual IEnumerable <IStaticText> StaticTextGetAll()
 {
     try
     {
         MySqlCommand command = new SystemDataCommandBuilder("SELECT StaticTextIdentifier,StaticTextType,SubjectTranslationIdentifier,BodyTranslationIdentifier FROM StaticTexts ORDER BY StaticTextType").Build();
         return(DataProvider.GetCollection <StaticTextProxy>(command));
     }
     catch (IntranetRepositoryException)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new IntranetRepositoryException(Resource.GetExceptionMessage(ExceptionMessage.RepositoryError, MethodBase.GetCurrentMethod().Name, ex.Message), ex);
     }
 }
Пример #4
0
 /// <summary>
 /// Gets all the data providers who handles payments.
 /// </summary>
 /// <returns>All the data providers who handles payments.</returns>
 public virtual IEnumerable <IDataProvider> DataProviderWhoHandlesPaymentsGetAll()
 {
     try
     {
         MySqlCommand command = new SystemDataCommandBuilder("SELECT DataProviderIdentifier,Name,HandlesPayments,DataSourceStatementIdentifier FROM DataProviders WHERE HandlesPayments=1 ORDER BY Name").Build();
         return(DataProvider.GetCollection <DataProviderProxy>(command));
     }
     catch (IntranetRepositoryException)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new IntranetRepositoryException(Resource.GetExceptionMessage(ExceptionMessage.RepositoryError, MethodBase.GetCurrentMethod().Name, ex.Message), ex);
     }
 }
Пример #5
0
 /// <summary>
 /// Gets a static text by a given static text type.
 /// </summary>
 /// <param name="staticTextType">Static text type for which to get the static text.</param>
 /// <returns>Static text.</returns>
 public virtual IStaticText StaticTextGetByStaticTextType(StaticTextType staticTextType)
 {
     try
     {
         MySqlCommand command = new SystemDataCommandBuilder("SELECT StaticTextIdentifier,StaticTextType,SubjectTranslationIdentifier,BodyTranslationIdentifier FROM StaticTexts WHERE StaticTextType=@staticTextType")
                                .AddStaticTextTypeIdentifierParameter(staticTextType)
                                .Build();
         var staticText = DataProvider.GetCollection <StaticTextProxy>(command).SingleOrDefault(m => m.Type == staticTextType);
         if (staticText == null)
         {
             throw new IntranetRepositoryException(Resource.GetExceptionMessage(ExceptionMessage.CantFindObjectById, typeof(IStaticText).Name, staticTextType));
         }
         return(staticText);
     }
     catch (IntranetRepositoryException)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new IntranetRepositoryException(Resource.GetExceptionMessage(ExceptionMessage.RepositoryError, MethodBase.GetCurrentMethod().Name, ex.Message), ex);
     }
 }