public string GenerateMemeberId() { Random rand = new Random(); string[] registrationDateSplited = DateOfRegistration.ToString("dd/MM/yyyy").Split("-"); string memberNumber = String.Concat($"{registrationDateSplited[0]}{registrationDateSplited[1]}{registrationDateSplited[2]}_{rand.Next(100, 1000)}"); return(memberNumber); }
public override string ToString() { string ID = "ID" + this.ID.ToString(); string customerName = "Name: " + Name.ToString(); string dateOfRegistration = "Date Of Registration: " + DateOfRegistration.ToString(); string enteranceDate = ""; if (EntranceDate == DateTime.MinValue) { enteranceDate = "No Enterance Date"; } else { enteranceDate = EntranceDate.ToString(); } string loyalCustomer = "Loyal Customer: " + LoyalCustomer.ToString(); string rate = "Rate: €" + Rate.ToString(); string balance = "Balance: €" + Balance.ToString(); string cardnumbers = "Cardnumbers: <"; foreach (string s in Cardnumbers) { cardnumbers += s + ", "; } cardnumbers = cardnumbers.Remove(cardnumbers.Length - 2, 2) + ">"; string spotInfo = ID + ", " + customerName + ", " + DateOfRegistration + ", " + enteranceDate + ", " + loyalCustomer + ", " + rate + ", " + balance + ", " + cardnumbers; return(spotInfo); }
public void DisplayInfo() { string formattedDate = DateOfRegistration.ToString("dd-MMM-yyyy"); Console.WriteLine($"{FirstName} {LastName} | Registered on: {formattedDate}"); }
public override string ToString() { string output = Name + ", " + NumberOfPurchases + ", " + TotalSumOfPurchases + ", " + DateOfRegistration.ToString("dd.MM.yyyy") + ", " + GetRating(); return(output.ToString()); }