protected void ToString(List <string> toStringOutput) { toStringOutput.Add($"Id = {(Id == null ? "null" : Id == string.Empty ? "" : Id)}"); toStringOutput.Add($"CardBrand = {(CardBrand == null ? "null" : CardBrand.ToString())}"); toStringOutput.Add($"Last4 = {(Last4 == null ? "null" : Last4 == string.Empty ? "" : Last4)}"); toStringOutput.Add($"ExpMonth = {(ExpMonth == null ? "null" : ExpMonth.ToString())}"); toStringOutput.Add($"ExpYear = {(ExpYear == null ? "null" : ExpYear.ToString())}"); toStringOutput.Add($"CardholderName = {(CardholderName == null ? "null" : CardholderName == string.Empty ? "" : CardholderName)}"); toStringOutput.Add($"BillingAddress = {(BillingAddress == null ? "null" : BillingAddress.ToString())}"); toStringOutput.Add($"Fingerprint = {(Fingerprint == null ? "null" : Fingerprint == string.Empty ? "" : Fingerprint)}"); toStringOutput.Add($"CardType = {(CardType == null ? "null" : CardType.ToString())}"); toStringOutput.Add($"PrepaidType = {(PrepaidType == null ? "null" : PrepaidType.ToString())}"); toStringOutput.Add($"Bin = {(Bin == null ? "null" : Bin == string.Empty ? "" : Bin)}"); }
private string Validate(string propName) { if (propName == nameof(CardType)) { if (string.IsNullOrEmpty(CardNumber)) { return(propName + emptyCell); } } if (propName == nameof(CardNumber)) { if (string.IsNullOrEmpty(CardNumber)) { return(propName + emptyCell); } if (CardNumber.Length != properLenght) { return(propName + chainLenght + properLenght); } } if (propName == nameof(ExpMonth)) { if (string.IsNullOrEmpty(ExpMonth.ToString())) { return(propName + emptyCell); } if (ExpMonth > 12 || ExpMonth < 1) { return(propName + monthNotValid); } } if (propName == nameof(ExpYear)) { if (string.IsNullOrEmpty(ExpYear.ToString())) { return(propName + emptyCell); } if (ExpYear > 3000 || ExpYear < 1990) { return(propName + monthNotValid); } } return(null); }
private void Tb_date_OnTap(object sender, GestureEventArgs e) { var dateselector = new CardDateSelectorControl { Height = ActualHeight, Width = ActualWidth }; dateselector.Closed += (o, args) => { var eventArgs = (PayNowEventArgs)args; var date = (List <int>)eventArgs.Response; if (date == null) { return; } ExpMonth = date[0]; ExpYear = date[1] - 2000; tb_date.Text = ExpMonth.ToString(CultureInfo.InvariantCulture).PadLeft(2, '0') + " / " + ExpYear.ToString(CultureInfo.InvariantCulture); }; dateSelectorPopup = new Popup { Child = dateselector, VerticalOffset = SystemTray.IsVisible ? Application.Current.Host.Content.ActualHeight - ActualHeight : 0, IsOpen = true }; //popup.IsOpen = true; }