Esempio n. 1
0
        void DoValidateControls()
        {
            switch (zoneType)
            {
            case (int)VmDnsZoneType.FORWARD:
                if (!VMDNSUtilityService.IsValidIPAddress(HostIPForwardZone.StringValue))
                {
                    throw new Exception(VMDNSConstants.IP_VALIDATE);
                }

                if (string.IsNullOrWhiteSpace(HostNameForwardZone.StringValue) ||
                    string.IsNullOrWhiteSpace(ZoneNameForwardZone.StringValue))
                {
                    throw new Exception("One or more required fields are empty");
                }
                break;

            case (int)VmDnsZoneType.REVERSE:
                if (string.IsNullOrWhiteSpace(HostNameReverseZone.StringValue) || string.IsNullOrWhiteSpace(NetworkIDReverseZone.StringValue) ||
                    string.IsNullOrWhiteSpace(NoBitsReverseZone.StringValue))
                {
                    throw new Exception("One or more required fields are empty");
                }
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
        protected override void DoValidateControls()
        {
            if (!VMDNSUtilityService.IsValidIPAddress(HostIPField.StringValue))
            {
                throw new Exception(VMDNSConstants.IP_VALIDATE);
            }

            if (string.IsNullOrWhiteSpace(HostNameField.StringValue))
            {
                throw new ArgumentNullException(VMIdentityConstants.EMPTY_FIELD);
            }
        }
Esempio n. 3
0
        protected override void DoValidateControls()

        {
            if (!VMDNSUtilityService.IsValidIPAddress(AddRecordFrm.ARecordHostIPText.Text))
            {
                throw new Exception(VMDNSConstants.IP_VALIDATE);
            }



            if (string.IsNullOrWhiteSpace(AddRecordFrm.ARecordHostNameText.Text))
            {
                throw new ArgumentNullException(MMCUIConstants.VALUES_EMPTY);
            }
        }