Пример #1
0
        public static void getUserChoice()
        {
            CustomerRepositary customerRepositary;
            Customer           customerObj;
            Seller             sellerObj;
            SellerRepositary   sellRepositary;
            LogInManager       loginObj = new LogInManager();

            Console.WriteLine(Text.FirstOption);
            short userOption = short.Parse(Console.ReadLine());

            switch (userOption)
            {
            case 1:
                Console.WriteLine(Text.SecondOption);
                short temp = Int16.Parse(Console.ReadLine());
                if (temp == 1)
                {
                    customerObj        = new Customer();
                    customerRepositary = new CustomerRepositary();
                    customerObj.getCustomerRegistration();
                    customerObj.Role = "Customer";
                    loginObj.userLogIn();
                }
                else if (temp == 2)
                {
                    sellRepositary = new SellerRepositary();
                    sellerObj      = new Seller();
                    sellerObj.getSellerRegistration();
                    sellerObj.Role = "Seller";
                    loginObj.userLogIn();
                }
                break;

            case 2:
                loginObj.userLogIn();
                break;

            case 3:
                System.Environment.Exit(0);
                break;

            default:
                break;
            }
            Console.WriteLine(Text.ThirdOption);
            bool istrue = (Console.ReadLine() == "yes" || Console.ReadLine() == "Yes" || Console.ReadLine() == "YES");

            if (istrue)
            {
                getUserChoice();
            }
        }
Пример #2
0
        public void getSellerRegistration()
        {
            RegistrationValidation userRegister = new RegistrationValidation();

            Seller seller = new Seller
            {
                Name        = userRegister.getName(),
                UserName    = userRegister.getUserName(),
                MailId      = userRegister.getMailId(),
                PhoneNumber = userRegister.getPhoneNumber(),
                Role        = "Seller",
                Password    = userRegister.getPassword()
            };
            SellerRepositary sellerRepos = new SellerRepositary();

            if (sellerRepos.addSeller(seller) >= 1)
            {
                Console.WriteLine("\nSeller Added...");
            }
            else
            {
                Console.WriteLine("\nSeller Does not Added...");
            }
        }
Пример #3
0
        static void initializeSellers()
        {
            SellerRepositary sellerRepos = new SellerRepositary();

            sellerRepos.addSellerIntoList();
        }