private void CreateAccount() { int id = 0; string name = controller.GetInput("Name: "); string surname = controller.GetInput("Surname: "); string address = controller.GetInput("Address: "); string email = controller.GetInput("E-mail: "); userLogin = email; string password = controller.GetPassword(); Customer newCustomer = new Customer(id, name, surname, address, email, password); database.AddCustomer(newCustomer); }
/// <include file='../Docs/Repositories.xml' path='docs/members[@name="Repository"]/SaveCustomer/*'/> public Result <Unit> SaveCustomer(string customer) { if (customer.Trim().Equals(string.Empty)) { return(new Failure <Unit>(0, "Customer name cannot be empty")); } try { _database.AddCustomer(customer); return(new Success <Unit>(new Unit())); } catch (Exception ex) { return(new Failure <Unit>(0, "Customer name cannot be empty", ex)); } }