//회원가입, 회원등록 기능, ID는 유일한 값만 가질 수 있음
        public void SignUp()
        {
            int cnt = 0;

            MemberVO Temp = new MemberVO(null, null, null, null, null);

            print.BasePage();
            Console.Write("Input new ID : ");
            Temp.MemberID = Exc.CheckIdInput();

            foreach (MemberVO i in MemberInfoListBot)
            {
                if (Temp.MemberID == i.MemberID)
                {
                    cnt++;
                }
            }
            while (cnt > 0)
            {
                Console.WriteLine("Sorry, that ID is already taken");
                Console.Write("Input new ID : ");
                Temp.MemberID = Exc.CheckIdInput();
                cnt           = 0;
                foreach (MemberVO i in MemberInfoListBot)
                {
                    if (Temp.MemberID == i.MemberID)
                    {
                        cnt++;
                    }
                }
            }
            Console.WriteLine();
            Console.Write("Input new PW : ");
            Temp.MemberPSWD = Exc.CheckPasswordInput();
            Console.WriteLine("\n");
            Console.Write("Input new Name : ");
            Temp.MemberNAME = Exc.CheckMemberNameInput();

            MemberInfoListBot.Add(Temp);

            print.BasePage();
            Console.WriteLine("Welcome " + Temp.MemberNAME);
            print.EnterReturn();
        }
Example #2
0
        public void MainPage()
        {
            //임시로 회원과 도서정보를 넣어둠
            MemberVO Manager = new MemberVO("wogur6782", "123456789", "신재혁", null, null);

            MemberInfoListTop.Add(Manager);
            BookVO test = new BookVO("Leading", "Alex Ferguson", 12000, 1);

            BookInfoListTop.Add(test);
            BookVO test1 = new BookVO("About Mac", "Steve Jobs", 12000, 1);

            BookInfoListTop.Add(test1);
            BookVO test2 = new BookVO("Learn C#", "Lionel Messi", 1000, 1);

            BookInfoListTop.Add(test2);

            SignInProcess       signIn       = new SignInProcess(MemberInfoListTop, SignedIn);
            MemberManageProcess memberManage = new MemberManageProcess(MemberInfoListTop);
            BookManageProcess   bookManage   = new BookManageProcess(BookInfoListTop);
            LoanManageProcess   loanManage   = new LoanManageProcess(MemberInfoListTop, BookInfoListTop);

            int SelectMode;

            print.StartPage();
            SelectMode = Exc.CheckNumberInput(SELECTMODE_RANGE_START, SELECTMODE_RANGE_END);
            while (true)
            {
                switch (SelectMode)
                {
                case 1:    //로그인 기능 및 회원 등록(가입)
                    signIn.SignInPage();
                    MemberInfoListTop = signIn.getMemberInfoListBot();
                    SignedIn          = signIn.getSignedIn();
                    break;

                case 2:    //로그인 했을 시 회원관리모드로 들어갈 수 있음
                    if (SignedIn == true)
                    {
                        memberManage.MemberPage();
                        MemberInfoListTop = memberManage.getMemberInfoListBot();
                    }
                    else
                    {
                        print.BasePage();
                        Console.WriteLine("Sign In First");
                        print.EnterReturn();
                    }
                    break;

                case 3:    //로그인 했을 시 도서관리모드로 들어갈 수 있음
                    if (SignedIn == true)
                    {
                        bookManage.BookPage();
                        BookInfoListTop = bookManage.getBookInfoListBot();
                    }
                    else
                    {
                        print.BasePage();
                        Console.WriteLine("Sign In First");
                        print.EnterReturn();
                    }
                    break;

                case 4:    //로그인 했을 시 도서대출반납모드로 들어갈 수 있음
                    if (SignedIn == true)
                    {
                        loanManage.LoanPage();
                        MemberInfoListTop = loanManage.getMemberInfoListBot();
                        BookInfoListTop   = loanManage.getBookInfoListBot();
                    }
                    else
                    {
                        print.BasePage();
                        Console.WriteLine("Sign In First");
                        print.EnterReturn();
                    }
                    break;

                case 5:    //프로그램 종료
                    if (print.ConfirmingProcess() == CONFIRM_YES)
                    {
                        print.ExitPage();
                        Environment.Exit(1);
                    }
                    else
                    {
                        break;
                    }
                    break;
                }
                print.StartPage();
                SelectMode = Exc.CheckNumberInput(SELECTMODE_RANGE_START, SELECTMODE_RANGE_END);
            }
        }