Esempio n. 1
0
 // Return a string suitable for writing the customer information to the customers.txt
 // file.
 public string ToFileString()
 {
     // Round the charge amount to two decimal places, but do not include a "$" in
     // the text file.
     return(AccountNo.ToString() + "," + CustomerName + "," + CustomerType + ","
            + ChargeAmount.ToString("0.##"));
 }
Esempio n. 2
0
 // Return a string suitable for displaying the customer information to the screen.
 public override string ToString()
 {
     // The charge amount can be displayed to the screen using the currency format.
     return(AccountNo.ToString() + "\t" + CustomerName + "\t" + CustomerType + "\t"
            + ChargeAmount.ToString("c"));
 }
Esempio n. 3
0
 public override String ToString()
 {
     return(AccountNo.ToString());
 }
Esempio n. 4
0
 public override string ToString()
 {
     return(AccountNo.ToString() + " - " + LastName + ", " + FirstName);
 }
Esempio n. 5
0
 public override string ToString() // overrides system method for CustormerDB->savecustomers()
 {
     return(AccountNo.ToString() + "," + CustomerName + "," + CustomerType + "," + ChargeAmount.ToString());
 }
Esempio n. 6
0
        private string Validate(string propertyName)
        {
            // Return error message if there is error on else return empty or null string
            string validationMessage = string.Empty;

            if (_firstLoad)
            {
                return(validationMessage);
            }
            switch (propertyName)
            {
            case "Details":     // property name
                if (string.IsNullOrWhiteSpace(Details))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "Name":     // property name
                if (string.IsNullOrWhiteSpace(Name))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberFather":     // property name
                if (string.IsNullOrWhiteSpace(Name))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "MemberMother":     // property name
                if (string.IsNullOrWhiteSpace(Name))
                {
                    validationMessage = "No Details Available";
                }
                break;

            case "AccountNo":
                if (!int.TryParse(AccountNo.ToString(), out uselessParseInt))
                {
                    validationMessage = "Only Digits Are Allowed";
                }
                break;

            case "Deposit":
                if (!double.TryParse(Deposit.ToString(), out uselessParse))
                {
                    validationMessage = "Only Digits Are Allowed";
                }
                break;

            case "Withdraw":
                if (!double.TryParse(Withdraw.ToString(), out uselessParse))
                {
                    validationMessage = "Only Digits Are Allowed";
                }
                break;
            }

            return(validationMessage);
        }
 public string ToFileString()
 {
     return(AccountNo.ToString() + "/" + CustomerName + "/" + CustomerType.ToString() + "/" + ChargeAmount.ToString());
 }