public IReadOnlyDictionary <long, StateData> Get(string language, params long[] ids) { var idsTable = TableParameters.GeIdsTable("Ids", ids.Distinct().ToArray()); var list = _executor.Array <dynamic>("[dbo].[State_GetOrderedList]", new TableParameters(idsTable)); var table = new DataTable("Localizations"); table.Columns.Add("Value"); table.Rows.Add(language); var localizations = _executor.Array <dynamic>( "[dbo].[StateLocalization_Get]", new TableParameters(idsTable, table)) .GroupBy(x => x.StateId) .ToDictionary(x => x.Key, x => x.ToDictionary(y => y.TwoLetterISOLanguageName, y => y.Name)); return(list.ToDictionary(x => (long)x.Id, x => new StateData { Name = x.Name, Position = x.Position, LocalizedName = localizations[x.Id][language], IsSystem = x.IsSystem })); }
public Dictionary <long, decimal> GetTariffs(long[] ids) { var table = TableParameters.GeIdsTable("Ids", ids); var tariffs = _executor.Array <dynamic>("[dbo].[Sender_GetTariffs]", new TableParameters(table)); return(tariffs.ToDictionary(x => (long)x.Id, x => (decimal)x.TariffOfTapePerBox)); }
public ReadOnlyCollection <FileInfo> GetNames(long applicationId, ApplicationFileType type) { var idsTable = TableParameters.GeIdsTable("AppIds", new[] { applicationId }); var parameters = new TableParameters(new { TypeId = type }, idsTable); var names = _executor.Array <dynamic>("[dbo].[ApplicationFile_GetNames]", parameters) .Select(x => new FileInfo { Name = x.Name, Id = x.Id }).ToArray(); return(new ReadOnlyCollection <FileInfo>(names)); }
public EmailTemplateLocalizationData GetLocalization(long templateId, string language) { var table = new DataTable("Localizations"); table.Columns.Add("Value"); table.Rows.Add(language); return(_executor.Array <EmailTemplateLocalizationData>( "[dbo].[EmailTemplateLocalization_Get]", new TableParameters(new { TemplateId = templateId }, table)) .Single()); }
public ClientData[] GetAll() { return(_executor.Array <ClientData>("[dbo].[Client_GetAll]")); }
public CountryData[] All(string language) { return(_executor.Array <CountryData>("[dbo].[Country_GetList]", new { language })); }
public RoleType[] GetRecipientRoles(EventType eventType) { return(_executor.Array <RoleType>("[dbo].[EventEmailRecipient_Get]", new { EventTypeId = (int)eventType })); }
public ClientBalanceHistoryItem[] GetHistory(long clientId) { return(_executor.Array <ClientBalanceHistoryItem>("[dbo].[ClientBalanceHistory_Get]", new { clientId })); }
public TransitData[] Get(params long[] ids) { var idsTable = TableParameters.GeIdsTable("Ids", ids.Distinct().ToArray()); return(_executor.Array <TransitData>("[dbo].[Transit_Get]", new TableParameters(idsTable))); }
public CalculationData[] GetByClient(long clientId) { return(_executor.Array <CalculationData>("[dbo].[Calculation_GetByClient]", new { clientId })); }
public StateRole[] GetStateAvailabilities() { return(_executor.Array <StateRole>("[dbo].[State_GetStateAvailabilities]")); }
public CarrierData[] GetAll() { return(_executor.Array <CarrierData>("[dbo].[Carrier_GetAll]")); }
public ForwarderData[] GetAll() { return(_executor.Array <ForwarderData>("[dbo].[Forwarder_GetAll]")); }