Example #1
0
        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
            }));
        }
Example #2
0
        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));
        }
Example #3
0
        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));
        }
Example #4
0
        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());
        }
Example #5
0
 public ClientData[] GetAll()
 {
     return(_executor.Array <ClientData>("[dbo].[Client_GetAll]"));
 }
Example #6
0
 public CountryData[] All(string language)
 {
     return(_executor.Array <CountryData>("[dbo].[Country_GetList]", new { language }));
 }
Example #7
0
 public RoleType[] GetRecipientRoles(EventType eventType)
 {
     return(_executor.Array <RoleType>("[dbo].[EventEmailRecipient_Get]", new { EventTypeId = (int)eventType }));
 }
Example #8
0
 public ClientBalanceHistoryItem[] GetHistory(long clientId)
 {
     return(_executor.Array <ClientBalanceHistoryItem>("[dbo].[ClientBalanceHistory_Get]", new { clientId }));
 }
Example #9
0
        public TransitData[] Get(params long[] ids)
        {
            var idsTable = TableParameters.GeIdsTable("Ids", ids.Distinct().ToArray());

            return(_executor.Array <TransitData>("[dbo].[Transit_Get]", new TableParameters(idsTable)));
        }
Example #10
0
 public CalculationData[] GetByClient(long clientId)
 {
     return(_executor.Array <CalculationData>("[dbo].[Calculation_GetByClient]", new { clientId }));
 }
Example #11
0
 public StateRole[] GetStateAvailabilities()
 {
     return(_executor.Array <StateRole>("[dbo].[State_GetStateAvailabilities]"));
 }
Example #12
0
 public CarrierData[] GetAll()
 {
     return(_executor.Array <CarrierData>("[dbo].[Carrier_GetAll]"));
 }
Example #13
0
 public ForwarderData[] GetAll()
 {
     return(_executor.Array <ForwarderData>("[dbo].[Forwarder_GetAll]"));
 }