Пример #1
0
        public static void ShowWorkOffers()
        {
            List <WorkOffer> workOffers = WorkOffersStorage.GetWorkOffers();

            foreach (WorkOffer offer in workOffers)
            {
                offer.ShowWorkOfferInformation();
            }
        }
Пример #2
0
        /// <summary>
        /// Method used for confirm chosen action by Contractor.
        /// </summary>
        /// <param name="user"></param>
        /// <param name="choosenAction"></param>
        /// <returns></returns>
        public static bool CompleteActionForContractor(User user, char choosenAction)
        {
            Contractor contractor = (Contractor)user;

            ShowOffers showOffers = MainMenuHelper.ShowWorkOffers;

            switch (choosenAction)
            {
            case '1':
            {
                showOffers();
            }
            break;

            case '2':
            {
                Console.WriteLine("Please, enter work offer name:");
                string enteredWorkOfferName = Console.ReadLine();

                var workOffer = WorkOffersStorage.GetWorkOffer(enteredWorkOfferName);

                contractor.CreateApplicationToWorkOffer(workOffer);
            }
            break;

            case '3':
            {
                var workOffers = WorkOffersStorage.GetWorkOffers(contractor);

                foreach (WorkOffer offer in workOffers)
                {
                    offer.ShowWorkOfferInformation();
                }
            }
            break;

            case '4':
            {
                Console.WriteLine("Please, enter work offer name:");
                string enteredWorkOfferName = Console.ReadLine();

                var workOffer = WorkOffersStorage.GetWorkOffer(enteredWorkOfferName);

                contractor.CheckUpConstructionWork(workOffer);
            }
            break;

            case '5':
            {
                Authentication.LogOut();
                return(Constants.IfUserWantLogOut);
            }
            }

            return(Constants.IfUserWantContinue);
        }
Пример #3
0
        /// <summary>
        /// Method used for confirm chosen action by customer.
        /// </summary>
        /// <param name="user"></param>
        /// <param name="choosenAction"></param>
        /// <returns></returns>
        public static bool CompleteActionForCustomer(User user, char choosenAction)
        {
            Customer customer = (Customer)user;

            switch (choosenAction)
            {
            case '1':
            {
                customer.CreateWorkOffer();
            }
            break;

            case '2':
            {
                var workOffers = WorkOffersStorage.GetWorkOffers(customer);

                foreach (WorkOffer workOffer in workOffers)
                {
                    workOffer.ShowWorkOfferInformation();
                }
            }
            break;

            case '3':
            {
                Console.WriteLine("Please, enter work offer name:");
                string enteredWorkOfferName = Console.ReadLine();

                var workOffer = WorkOffersStorage.GetWorkOffer(enteredWorkOfferName);

                Console.WriteLine("Selected work offer:\n" +
                                  $"{workOffer}");

                Console.WriteLine("Please, choose action:\n" +
                                  "1.Show applications to work offer.\n" +
                                  "2.Confirm application.");

                char chosenActionForWorkOffer = Char.Parse(Console.ReadLine());

                MainMenuHelper.PerformApplicationAction(workOffer, chosenActionForWorkOffer, customer);
            }
            break;

            case '4':
            {
                Authentication.LogOut();
                return(Constants.IfUserWantLogOut);
            }
            }

            return(Constants.IfUserWantContinue);
        }