Exemplo n.º 1
0
 private string GetDomainName(DeliveryGroup dvg)
 {
     var domain = _oenRepository.GetDomains().FirstOrDefault(d => d.enabled && (d.domainGroup_id == dvg.domaingroup_id));
     return (domain != null) ? domain.host : null;
 }
Exemplo n.º 2
0
        public void VerifyDeliveryGroup(DeliveryGroup deliveryGroup)
        {
            if (!deliveryGroup.enabled)
            {
                OnError(this, new DataEventArgs<Exception>(new InvalidOperationException(String.Format(InvalidDeliveryGroupMsg, deliveryGroup.deliveryGroup_id, "Not enabled."))));
            }

            if (!(deliveryGroup.IncludeInAutomatedWarmingProcess == true))
            {
                OnError(this, new DataEventArgs<Exception>(new InvalidOperationException(String.Format(InvalidDeliveryGroupMsg, deliveryGroup.deliveryGroup_id, "Not included for Automated Warming Process."))));
            }

            typeof(DeliveryGroup)
                .GetProperties()
                .Where(x => x.PropertyType == typeof(int?))
                .ToList()
                .ForEach(x =>
                {
                    var awpSetting = x.GetCustomAttributes(typeof(AWPSettingAttribute), false).FirstOrDefault();

                    if (awpSetting != null)
                    {
                        if (x.GetValue(deliveryGroup) == null)
                        {
                            throw new InvalidOperationException(string.Format("Missing Required Information '{0}' for Delivery Group '{1}'.", (awpSetting as AWPSettingAttribute).Description, deliveryGroup.deliveryGroup_id));
                        }
                    }
                });
        }