Exemplo n.º 1
0
        public SubscriptionPlan GetValidSubscriptionPlanByCompanyId(int companyId)
        {
            DBHelper.APIService dbhelp = new DBHelper.APIService();
            var subscriptionPlanList   = dbhelp.GetValidSubscriptionPlanByCompanyId(companyId);

            if (subscriptionPlanList == null || subscriptionPlanList.Count == 0)
            {
                throw new CDSException(10303);
            }

            return(subscriptionPlanList.Select(s => new SubscriptionPlan()
            {
                Id = s.Id,
                SubscriptionPlanID = s.SubscriptionPlanID,
                SubscriptionPlanName = s.SubscriptionPlan.Name,
                SubscriptionName = s.SubscriptionName,
                RatePer1KMessageIngestion = (float)s.RatePer1KMessageIngestion,
                RatePer1KMessageHotStore = (float)s.RatePer1KMessageHotStore,
                RatePer1KMessageColdStore = (float)s.RatePer1KMessageColdStore,
                StartDate = (DateTime)s.StartDate,
                ExpiredDate = (DateTime)s.ExpiredDate,
                MaxMessageQuotaPerDay = (int)s.MaxMessageQuotaPerDay,
                CosmosDBConnectionString = s.CosmosDBConnectionString,
                CosmosDBCollectionTTL = (int)s.CosmosDBCollectionTTL,
                CosmosDBCollectionReservedUnits = (int)s.CosmosDBCollectionReservedUnits,
                IoTHubConnectionString = s.IoTHubConnectionString,
                StorageConnectionString = s.StorageConnectionString
            }).FirstOrDefault <SubscriptionPlan>());
        }
Exemplo n.º 2
0
        public void deleteSystemConfiguration(int id)
        {
            DBHelper.APIService dbhelp = new DBHelper.APIService();
            SystemConfiguration existingSystemConfiguration = dbhelp.GetSystemConfigurationById(id);

            dbhelp.DeleteSystemConfiguration(existingSystemConfiguration);
        }
Exemplo n.º 3
0
        public void updateSystemConfiguration(int id, Edit systemConfiguration)
        {
            DBHelper.APIService dbhelp = new DBHelper.APIService();
            SystemConfiguration existingSystemConfiguration = dbhelp.GetSystemConfigurationById(id);

            existingSystemConfiguration.Group = systemConfiguration.Group;
            existingSystemConfiguration.Key   = systemConfiguration.Key;
            existingSystemConfiguration.Value = systemConfiguration.Value;

            dbhelp.UpdateSystemConfiguration(existingSystemConfiguration);
        }
Exemplo n.º 4
0
        public List <Detail> GetAllSystemConfiguration()
        {
            DBHelper.APIService dbhelp = new DBHelper.APIService();

            return(dbhelp.GetAllSystemConfiguration().Select(s => new Detail()
            {
                Group = s.Group,
                Key = s.Key,
                Value = s.Value
            }).ToList <Detail>());
        }
Exemplo n.º 5
0
        public void addSystemConfiguration(Edit systemConfiguration)
        {
            DBHelper.APIService dbhelp = new DBHelper.APIService();
            var newSystemConfiguration = new SystemConfiguration()
            {
                Group = systemConfiguration.Group,
                Key   = systemConfiguration.Key,
                Value = systemConfiguration.Value
            };

            dbhelp.AddSystemConfiguration(newSystemConfiguration);
        }