Beispiel #1
0
        private bool loginUser()
        {
            bool   loginUser = false;
            string userName = "", userPassword = "";

            Console.Write("                 Enter username: "******"                 Enter password: ");
            userPassword = Console.ReadLine();
            userBO     userBo = new userBO(userName, userPassword);
            logicLayer bll    = new logicLayer();

            loginUser = bll.loginUser(userBo);
            return(loginUser);
        }
Beispiel #2
0
        private bool AdminAccountManagment()
        {
            string adminName = "", adminPassword = "";

            Console.Write("                 Enter Admin username: "******"                 Enter Admin password: "******"");
            Console.WriteLine("");
            Console.WriteLine("");
            bool admin = bll.loginAdmin(adminBo);

            return(admin);
        }
Beispiel #3
0
        private void EmployeeManagement()
        {
            int        option = 0;
            logicLayer bll    = new logicLayer();

            Console.WriteLine("                 Press 1 to Add an Employee.");
            Console.WriteLine("                 Press 2 to Edit an Employee.");
            Console.WriteLine("                 Press 3 to Delete an Employee.");
            Console.WriteLine("                 Press 4 to Search an Employee.");
            Console.WriteLine("                 Press 0 to log out.");
            Console.WriteLine("");
            Console.WriteLine("");
            int[] arr = { 1, 2, 3, 4, 0 };
            Console.Write("        Enter choice: ");
            option = getRightOption(arr);
            Console.WriteLine("");
            Console.WriteLine("");
            if (option == 1)
            {
                bool wrongDesignation = false;
                wrongDesignation = addEmployee();
                if (wrongDesignation == true)
                {
                    Console.WriteLine("");
                    Console.WriteLine("");
                    Console.WriteLine("                        ** You have entered wrong designation **        ");
                    Console.WriteLine("");
                    Console.WriteLine("");
                    Console.WriteLine("        Kindly Try Again!!!                   ");
                    Console.WriteLine("");
                    Console.WriteLine("");
                    EmployeeManagement();
                }
                else
                {
                    Console.WriteLine("");
                    Console.WriteLine("");
                    Console.WriteLine("                        ** Saved **                     ");
                }
            }
            else if (option == 2)
            {
                bool wrongDesignation = false;
                wrongDesignation = editEmployee();
                if (wrongDesignation == true)
                {
                    Console.WriteLine("");
                    Console.WriteLine("");
                    Console.WriteLine("                        ** You have entered wrong designation **        ");
                    Console.WriteLine("");
                    Console.WriteLine("");
                    Console.WriteLine("        Kindly Try Again!!!                   ");
                    Console.WriteLine("");
                    Console.WriteLine("");
                    EmployeeManagement();
                }
                Console.WriteLine("");
                Console.WriteLine("");
            }
            else if (option == 3)
            {
                deleteEmployee();
            }
            else if (option == 4)
            {
                searchEmployee();
            }
            else if (option == 0)
            {
                start();
            }
        }