public void CreateAccount()
        {
            //Creating a new customer.
            Model.Customer newCustomer = new Model.Customer();
            Console.WriteLine("Please enter your first name:");
            newCustomer.FirstName = Console.ReadLine();
            Console.WriteLine("Please enter your last name");
            newCustomer.LastName = Console.ReadLine();
            Console.WriteLine("Please enter e-mail:");
            newCustomer.Email = Console.ReadLine();
            Console.WriteLine("Enter address:");
            newCustomer.Address = Console.ReadLine();
            Console.WriteLine("Enter zip code:");
            newCustomer.ZipCode    = Int32.Parse(Console.ReadLine());
            newCustomer.CustomerID = RNG.numb.Next(1, 1001);

            //Reading back customer information.
            Console.WriteLine(linebreak);
            _biz.AddCustomer(newCustomer);
            Console.WriteLine("New account added.");
            Console.WriteLine(newCustomer.ToString());
            Console.WriteLine(linebreak);
            Console.WriteLine(presskey);
            Console.ReadLine();
        }
Beispiel #2
0
 public Entity.Customer ParseCustomer(Model.Customer customer)
 {
     return(new Entity.Customer
     {
         FName = customer.FirstName,
         LName = customer.LastName,
         EMail = customer.LastName,
         Address = customer.Address,
         Zip = customer.ZipCode,
         Id = customer.CustomerID
     });
 }
Beispiel #3
0
 Model.Customer I_GRDL.AddCustomer(Model.Customer newCustomer)
 {
     _context.Customers.Add(_mapper.ParseCustomer(newCustomer));
     _context.SaveChanges();
     return(newCustomer);
 }