public Customer(string fName, string lName, CustType custType, string emailText) { FName = fName; LName = lName; CustType = custType; EmailText = emailText; }
private void RemoveCustomer() { Console.Clear(); PrintAllItems(); Console.WriteLine("What is the first name for the customer would you like to remove?"); string fName = Console.ReadLine(); Console.WriteLine("What is the last name of the customer?"); string lName = Console.ReadLine(); CustType custType = CustType.Current; string emailText = "yo"; bool success = _custRepo.RemoveCustomerBySpecifications(fName, lName, custType, emailText); if (success == true) { Console.WriteLine($"{fName} {lName} was sucfcessfully removed."); Console.ReadKey(); } else { Console.WriteLine($"{fName} {lName} was unable to be removed at this time."); Console.ReadKey(); Console.Clear(); } }
public bool RemoveCustomerBySpecifications(string fName, string lName, CustType custType, string emailText) { bool successful = false; foreach (Customer customer in _customers) { if (customer.FName == fName && customer.LName == lName) { RemoveCustomer(customer); successful = true; break; } } return(successful); }
public virtual void GetDetails() { Console.WriteLine("Enter Customer ID : "); do { flagID = int.TryParse(Console.ReadLine(), out CustId); if (!flagID) { Console.WriteLine("Please choose a number as ID."); } } while (!(flagID)); Console.WriteLine("Enter Customer Name : "); do { Console.WriteLine("Customer Name should be atleat 3 character long."); CustName = Console.ReadLine(); } while (CustName.Length < 3); Console.Write("Building No.: "); do { flagb = int.TryParse(Console.ReadLine(), out address.buildingNo); if (!flagb) { Console.WriteLine("Please choose a number as Building Number."); } } while (!(flagb)); Console.Write("City: "); address.city = Console.ReadLine(); Console.Write("State: "); address.state = Console.ReadLine(); Console.Write("Country: "); address.country = Console.ReadLine(); Console.Write("Customer Type : "); do { Console.WriteLine(" press 1 for Premium, press 2 for Gold, press 3 for Exclusive"); string num = Console.ReadLine(); n = Convert.ToInt32(num); n = n - 1; type = (CustType)(n); } while (n > 3 || !(n is int)); }
public Customer(string ownerID, CustType custType) { this.AccountOwner = ownerID; this.CustomerType = custType; }
public Individual(string ownerID, CustType custtype) : base(ownerID, CustType.Individual) { }
public Company(string ownerID, CustType custType) : base(ownerID, CustType.Company) { }