Пример #1
0
        public ActionResult Create(FormCollection collection)
        {
            var newCustomer = new Customers(collection);

            customerServices.AddCustomer(newCustomer);
            return(RedirectToAction("Index"));
        }
Пример #2
0
        protected void btnAccept_Click(object sender, EventArgs e)
        {
            Customer customer = new Customer()
            {
                Name    = txtName.Text,
                Address = txtAddress.Text
            };

            CloudStorageAccount storage = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
            CustomerServices    service = new CustomerServices(new DataContext(storage));

            service.AddCustomer(customer);
            Response.Redirect("~/CustomerList.aspx");
        }
Пример #3
0
        /// <summary>
        /// Here start() allows the shopper/employee to be directed to the correct domain of the shop
        /// </summary>
        public void Start()
        {
            do
            {
                Console.WriteLine("Welcome to Lacrosse101, a store for all your lacrosse needs!");
                Console.WriteLine("Please choose one of the options below by typing the correspoing number.");
                Console.WriteLine("[0] Exit the Store \n[1] New Shopper \n[2] Store Manager \n[3] Returning Shopper Shop Equipment Here");
                shoperInput = Console.ReadLine();
                switch (shoperInput)
                {
                case "3":
                    Console.WriteLine("Welcome Shopper!");
                    Customer cust = CustomerValidation();
                    break;

                case "1":
                    Customer newCust = NewCustomerValidation();
                    customerServices.AddCustomer(newCust);
                    break;

                case "2":
                    Console.WriteLine("Welcome Manager!");
                    Manager man = ManagerValidation();
                    break;

                case "0":
                    Console.WriteLine("Goodbye!");
                    // this line will exit the current session
                    Environment.Exit(0);
                    break;

                default:
                    ValidInvalidServices.InvalidInput();
                    break;
                }
            } while (!shoperInput.Equals("3"));
        }