Пример #1
0
        public void UpdateLocations()
        {
            Location newLocation = new Location();

            Console.WriteLine("Enter New Location Address: ");
            newLocation.LocationAddress = Console.ReadLine();
            Console.WriteLine("Enter Location ID (##): ");
            newLocation.LocationID = int.Parse(Console.ReadLine());

            _locationBL.AddLocation(newLocation);
            Console.WriteLine($"New Location {newLocation.LocationAddress} created successfully!");
        }
        private void AddLocation()
        {
            string name    = _validate.ValidateEmptyInput("Enter Location Name:");
            string address = _validate.ValidateEmptyInput("Enter Location Address:");

            try
            {
                Location newBranch     = new Location(name, address);
                Location createdBranch = _locationBL.AddLocation(newBranch);
                Console.WriteLine($"New {createdBranch.Name} branch is created successfully.");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #3
0
        public void AddNewLocation()
        {
            //create new Location
            Location newLocation = new Location();

            Console.WriteLine("Enter locations address number and street:");
            newLocation.Address = Console.ReadLine();
            Console.WriteLine("Enter locations city:");
            newLocation.City = Console.ReadLine();
            Console.WriteLine("Enter locations state:");
            newLocation.State = Console.ReadLine();
            Console.WriteLine("Enter locations zipcode:");
            newLocation.Zipcode = Console.ReadLine();

            _locationBL.AddLocation(newLocation);

            Console.WriteLine($"New location added at {newLocation.Address} {newLocation.City}, {newLocation.State} ({newLocation.Zipcode})!");
            Log.Information($"New location added. Details:{newLocation.ToString()}");
        }
Пример #4
0
 public ActionResult Create(LocCRVM newLocation)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _locationBL.AddLocation(_mapper.cast2Location(newLocation));
             Log.Information($"Location created-- Name: {newLocation.LocName}");
             return(RedirectToAction(nameof(Index)));
         }
         catch (Exception e)
         {
             Helper.WriteError(e, "Error");
             Helper.WriteFatal(e, "Fatal");
             Helper.WriteVerbose(e, "Verbose");
             return(View());
         }
         finally
         {
         }
     }
     return(View());
 }
        /// <summary>
        /// UI to add a location
        /// </summary>
        private void AddALocation()
        {
            Console.WriteLine("\nEnter the details of the location you want to add");
            string name    = _validate.ValidateString("Enter the location name: ");
            string address = _validate.ValidateString("Enter the location street address: ");
            string city    = _validate.ValidateString("Enter the location city: ");
            string state   = _validate.ValidateString("Enter the location state: ");

            Log.Information("Location information input");
            try
            {
                // New location model created and sent to Business Logic
                int      numOfProducts = _productBL.GetAllProducts().Count;
                Location newLocation   = new Location(name, address, city, state);
                Log.Information("UI sent new location to BL");
                Location createdLocation = _locationBL.AddLocation(newLocation);
                Console.WriteLine("New Location Created\n");
                Console.WriteLine(createdLocation.ToString());
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #6
0
 public void CreateLocation()
 {
     _locationBL.AddLocation(GetLocationDetails());
     Console.WriteLine("Location Successfully Created!");
 }