public void ValidateData() { long lg = 0; DateTime dt = new DateTime(); if (!DateTime.TryParse(string.Format("{0}/{1}", ValidTillMonth, ValidTillYear), out dt)) { throw new ValidationException("Date in not valid"); } if (string.IsNullOrEmpty(CardNumber) || string.IsNullOrWhiteSpace(CardNumber)) { throw new ValidationException("Card Number is not valid"); } if (!long.TryParse(CardNumber.Trim().Replace(" ", ""), out lg)) { throw new ValidationException("Card Number is not valid"); } if (BankID < 0) { throw new BankNotFoundException(); } if (CadrID < 0) { throw new CardNotFoundException(); } }