Пример #1
0
        //회원 검색
        public MemberVO SearchMember(string searchType)
        {
            string searchID;

            switch (searchType)
            {
            case "editSearch":
                print.Search("정보를 편집할 회원의 아이디");
                break;

            case "removeSearch":
                print.Search("삭제할 회원의 아이디");
                break;

            case "justSearch":
                print.Search("검색할 회원의 아이디");
                break;
            }

            searchID = Console.ReadLine();

            MemberVO foundMember = dao.Select(searchID);

            if (searchType.Equals("justSearch"))
            {
                print.MemberInfo(foundMember);
                adminMenu.MemberManagementMenu();
            }
            return(foundMember);
        }
Пример #2
0
 public BookManagement(UserMenu userMenu, DAO dao, string logonID)
 {
     print         = Print.GetInstance();
     errorCheck    = ErrorCheck.GetInstance();
     this.userMenu = userMenu;
     this.dao      = dao;
     bookList      = new List <BookVO>();
     this.logonID  = logonID;
     logOnMember   = dao.Select(logonID);
 }
Пример #3
0
        //Insert statement
        public void Insert(MemberVO inputMember)
        {
            dataReader.Close();
            sqlQuery = "insert into member values('" + inputMember.Id + "', '" + inputMember.Password + "', '"
                       + inputMember.Name + "', '" + inputMember.Gender + "', '" + inputMember.PhoneNumber + "', '"
                       + inputMember.Email + "', '" + inputMember.Address + "', '" + inputMember.RentBook + "', '"
                       + inputMember.DueDate + "', '" + inputMember.ExtensionCount + "');";

            SendQuery(sqlQuery);
        }
Пример #4
0
        //Select statement
        public MemberVO Select(string id)
        {
            dataReader.Close();
            sqlQuery = "select * from member where id='" + id + "';";
            SendQuery(sqlQuery);
            dataReader.Read();
            MemberVO selectedMember = new MemberVO(dataReader["id"].ToString(), dataReader["password"].ToString(),
                                                   dataReader["name"].ToString(), dataReader["gender"].ToString(), dataReader["phoneNumber"].ToString(),
                                                   dataReader["email"].ToString(), dataReader["address"].ToString(), dataReader["rentbook"].ToString(), dataReader["duedate"].ToString(), 3);

            return(selectedMember);
        }
Пример #5
0
 public void DeleteMember(MemberVO inputMember)
 {
     Console.Clear();
     Console.WriteLine("\n\n\t---------------------------------삭제할 회원 기존 정보--------------------------------");
     Console.WriteLine("\n\t아이디 : {0}", inputMember.Id);
     Console.WriteLine("\t이름 : {0}", inputMember.Name);
     Console.WriteLine("\t성별 : {0}", inputMember.Gender);
     Console.WriteLine("\t핸드폰 번호 : {0}", inputMember.PhoneNumber);
     Console.WriteLine("\t이메일 : {0}", inputMember.Email);
     Console.WriteLine("\t주소 : {0}", inputMember.Address + "\n");
     Console.WriteLine("\t--------------------------------------------------------------------------------------");
     Console.Write("\n\n\t정말로 삭제하시겠습니까? (Y/N) : ");
 }
Пример #6
0
        //회원정보 수정
        public void EditMember()
        {
            MemberVO foundMember = SearchMember("editSearch");

            foundMember = print.EditMember(foundMember);

            dao.Update("member", "phoneNumber", foundMember.PhoneNumber, "id", foundMember.Id);
            dao.Update("member", "address", foundMember.Address, "id", foundMember.Id);

            dao.Insert("관리자", "회원정보수정", foundMember.Name, DateTime.Now);
            print.CompleteMsg("회원 정보 수정 완료");
            adminMenu.MemberManagementMenu();
            return;
        }
Пример #7
0
        public void MemberInfo(MemberVO inputMember)
        {
            Console.Clear();
            Console.WriteLine("\n\n\t---------------------------------검색한 회원 기존 정보--------------------------------");
            Console.WriteLine("\n\t아이디 : {0}", inputMember.Id);
            Console.WriteLine("\t학번 : {0}", inputMember.Name);
            Console.WriteLine("\t성별 : {0}", inputMember.Gender);
            Console.WriteLine("\t핸드폰 번호 : {0}", inputMember.PhoneNumber);
            Console.WriteLine("\t주소 : {0}", inputMember.Address);
            Console.WriteLine("\t현재 대출한 책 : {0}", inputMember.RentBook);
            Console.WriteLine("\t반납 예정일 : {0}", inputMember.DueDate + "\n");
            Console.WriteLine("\t연장 가능횟수 : {0}", inputMember.ExtensionCount + "\n");
            Console.WriteLine("\t--------------------------------------------------------------------------------------");

            Console.Write("\n\n\t이전으로 돌아가려면 엔터...");
            Console.ReadLine();
        }
Пример #8
0
        public MemberVO EditMember(MemberVO inputMember)
        {
            string phoneNumber, address;

            Console.Clear();
            Console.WriteLine("\n\n\t---------------------------------수정할 회원 기존 정보--------------------------------");
            Console.WriteLine("\n\t아이디 : {0}", inputMember.Id);
            Console.WriteLine("\t이름 : {0}", inputMember.Name);
            Console.WriteLine("\t성별 : {0}", inputMember.Gender);
            Console.WriteLine("\t핸드폰 번호 : {0}", inputMember.PhoneNumber);
            Console.WriteLine("\t이메일 주소 : {0}", inputMember.Email);
            Console.WriteLine("\t주소 : {0}", inputMember.Address + "\n");
            Console.WriteLine("\t--------------------------------------------------------------------------------------");
            Console.WriteLine("\n\n\t---------------------------------수정할 회원 정보 입력--------------------------------");

            while (true)
            {
                Console.Write("\n\t핸드폰 번호 입력(010-1234-5678 형식) : ");
                phoneNumber = Console.ReadLine();
                if (errorCheck.MemberPhone(phoneNumber) == false)
                {
                    break;
                }

                FormErrorMsg("핸드폰 번호");
            }

            while (true)
            {
                Console.Write("\n\n\t주소 입력(동/리까지 입력) : ");
                address = Console.ReadLine();
                if (errorCheck.MemberAddress(address) == false)
                {
                    break;
                }

                FormErrorMsg("주소");
            }
            inputMember.PhoneNumber = phoneNumber;
            inputMember.Address     = address;
            return(inputMember);
        }
Пример #9
0
        //회원 정보 삭제
        public void RemoveMember()
        {
            string confirm;

            MemberVO foundMember = SearchMember("removeSearch");

            print.DeleteMember(foundMember);

            confirm = Console.ReadLine();
            if (errorCheck.Confirm(confirm))
            {
                print.MenuErrorMsg("Y/N오류");
                adminMenu.MemberManagementMenu();
                return;
            }

            dao.Delete("member", "id", foundMember.Id);

            dao.Insert("관리자", "회원삭제", foundMember.Name, DateTime.Now);
            print.CompleteMsg("회원 삭제 완료");
            adminMenu.MemberManagementMenu();
            return;
        }
Пример #10
0
        public MemberVO RegisterMember() //while로 틀린 항목 다시 입력하게
        {
            string id, password, name, gender, phoneNumber, email, address;

            Console.Clear();
            while (true)
            {
                Console.Write("\n\n\t학번 입력 (6~8자리 이내) : ");
                id = Console.ReadLine();
                if (errorCheck.MemberID(id) == false)
                {
                    break;
                }

                FormErrorMsg("학번");
            }

            while (true)
            {
                Console.Write("\n\n\t비밀번호 입력 (숫자만 4자리) : ");
                password = Console.ReadLine();

                if (errorCheck.MemberPassword(password) == false)//미리 설정해둔 정규식에 맞으면 bool 타입 false 반환
                {
                    break;
                }

                FormErrorMsg("이름");
            }

            while (true)
            {
                Console.Write("\n\n\t이름 입력 (4자리 이내) : ");
                name = Console.ReadLine();

                if (errorCheck.MemberName(name) == false)//미리 설정해둔 정규식에 맞으면 bool 타입 false 반환
                {
                    break;
                }

                FormErrorMsg("이름");
            }

            while (true)
            {
                Console.Write("\n\n\t성별 입력 (남자/여자): ");
                gender = Console.ReadLine();
                if (errorCheck.MemberGender(gender) == false)
                {
                    break;
                }
                FormErrorMsg("성별");
            }

            while (true)
            {
                Console.Write("\n\n\t핸드폰 번호 입력(010-1234-5678 형식) : ");
                phoneNumber = Console.ReadLine();
                if (errorCheck.MemberPhone(phoneNumber) == false)
                {
                    break;
                }
                FormErrorMsg("핸드폰 번호");
            }

            while (true)
            {
                Console.Write("\n\n\t이메일 입력 : ");
                email = Console.ReadLine();

                if (errorCheck.MemberEmail(email) == false)
                {
                    break;
                }
                FormErrorMsg("이메일");
            }

            while (true)
            {
                Console.Write("\n\n\t주소 입력 : ");
                address = Console.ReadLine();
                if (errorCheck.MemberAddress(address) == false)
                {
                    break;
                }

                FormErrorMsg("주소");
            }

            MemberVO newMember = new MemberVO(id, password, name, gender, phoneNumber, email, address, "없음", "없음", 2);

            return(newMember);
        }