Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.5 kB
2
Indexable
Never
 public class ResponsePaymentSlipDto
    {
        public string debitName { get; set; }
        public string debitPlace { get; set; }
        public string debitCity { get; set; }
        public string creditName { get; set; }
        public string creditPlace { get; set; }
        public string creditCity { get; set; }
        public string creditAccount { get; set; }
        public string creditModel { get; set; }
        public string creditReferenceNumber { get; set; }
        public string paymentCode { get; set; }
        public string paymentPurpose { get; set; }
        public double amount { get; set; }

        public void Format()
        {
            debitPlace = (string.IsNullOrEmpty(debitPlace) || debitPlace.Length <= 35) ?
                debitPlace : debitPlace[..35];
            debitCity = (string.IsNullOrEmpty(debitCity) || debitCity.Length <= 25) ?
                debitCity : debitCity[..25];
            creditName = (string.IsNullOrEmpty(creditName) || creditName.Length <= 35) ?
                creditName : creditName[..35];
            creditPlace = (string.IsNullOrEmpty(creditPlace) || creditPlace.Length <= 35) ?
                creditPlace : creditPlace[..35];
            creditCity = (string.IsNullOrEmpty(creditCity) || creditCity.Length <= 20) ?
                creditCity : creditCity[..20];
            paymentPurpose = (string.IsNullOrEmpty(paymentPurpose) || paymentPurpose.Length <= 100) ?
                paymentPurpose : paymentPurpose[..100];
        }
    }