Exemple #1
0
        //회원등록
        public void RegisterMember()
        {
            MemberVO newMember;

            newMember = print.RegisterMember();

            sqlQuery = "select id from member;";
            SendQuery();

            //id중복체크
            while (dataReader.Read())
            {
                if (dataReader["id"].ToString().Equals(newMember.Id))
                {
                    CloseDB();
                    print.ErrorMsg("중복 아이디");
                    menu.MemberManagementMenu();
                    return;
                }
            }

            CloseDB();
            sqlQuery = "insert into member values('" + newMember.Id + "', '" + newMember.Password + "', '"
                       + newMember.Name + "', '" + newMember.Gender + "', '" + newMember.PhoneNumber + "', '"
                       + newMember.Email + "', '" + newMember.Address + "', '" + newMember.RentBook + "', '"
                       + newMember.DueDate + "', '" + newMember.ExtensionCount + "');";

            SendQuery();
            dataReader.Read();
            if (errorCheck.IsValidChange(dataReader) == false) //등록 에러
            {
                CloseDB();
                print.ErrorMsg("회원 등록");
                menu.MemberManagementMenu();
                return;
            }

            CloseDB();
            print.CompleteMsg("회원 등록 완료");
            menu.MemberManagementMenu();
            return;
        }
Exemple #2
0
        public void RegisterBook()
        {
            BookVO newBook;

            newBook = print.RegisterBook();

            sqlQuery = "insert into book values('" + newBook.Name + "', '" + newBook.Author + "', '"
                       + newBook.Publisher + "', " + newBook.Count + ");";
            SendQuery();
            while (dataReader.Read())
            {
                if (dataReader["name"].ToString().Equals(newBook.Name))
                {
                    CloseDB();
                    print.ErrorMsg("중복 아이디");
                    menu.MemberManagementMenu();
                    return;
                }
            }

            if (errorCheck.IsValidChange(dataReader) == false) //등록 에러
            {
                CloseDB();
                print.ErrorMsg("도서 등록");
                menu.BookManagementMenu();
                return;
            }

            CloseDB();
            print.CompleteMsg("도서 등록 완료");
            menu.BookManagementMenu();
            return;
        }