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; } }
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); } }
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); } }