public void mainMenu() { Console.Clear(); share.getDisplay().mainMenuDisplay(); input = share.getException().exceptKey("1", "2", "3", "/"); if (input == "1") //등록한 정보가 있으면 로그인 창으로 { Console.Clear(); share.getLogin().login(); } else if (input == "2") //회원 등록하기 { Console.Clear(); share.getMember().addMember("Membership Join"); mainMenu(); } else if (input == "3") //종료 { Console.WriteLine(" 프로그램 종료합니다 "); } else if (input == "/") { share.getLogin().adminLogin(); } //숨겨진 관리자 모드 오직 관리자만이 아는 명령어 }
public void booksAllSearchOfDB() //booktable에 있는 책들 전체 출력 { Console.Clear(); conn = new MySqlConnection(strConn); // conncet MySQL conn.Open(); String sql = "select * from book;"; MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader reader = cmd.ExecuteReader(); int count = 3; share.getDisplay().bookBar(); while (reader.Read()) { no = reader["no"].ToString(); bookname = reader["bookname"].ToString(); author = reader["author"].ToString(); price = reader["price"].ToString(); renting = reader["isRent"].ToString(); Console.SetCursorPosition(8, count); Console.Write(no); Console.SetCursorPosition(15, count); Console.Write(bookname); Console.SetCursorPosition(58, count); Console.Write(author); Console.SetCursorPosition(80, count); Console.Write(price); Console.SetCursorPosition(95, count); Console.Write(renting); count += 2; } reader.Close(); conn.Close(); }
public void login() { Console.Clear(); share.getDisplay().loginDisplay("Member Login"); //Console.SetCursorPosition(22, 6); inputId = share.getException().loginId(); Console.SetCursorPosition(22, 10); inputPwd = share.getException().inputpwd(); //패스워드 *표시 하는 예외처리 share.getMemberTable().loginUsingDB(inputId, inputPwd); }
public void addMember(string message) //회원정보 등록할 때 필요하다. { share.getDisplay().status(message); //등록 시 보일 디스플레이 string memeberId = share.getException().inputIdWhenAdd("\t ID"); //ID의 예외처리 6~10자리 사이 숫자와영어 조합만 가능 string memberPwd = share.getException().exceptString("Password"); //회원정보 등록할 때는 비밀번호가 보이게 한다. string memberName = share.getException().exceptName("Name"); string memberBirthday = share.getException().onlySixNumDigits(); share.getMemberTable().addMemberInDB(memeberId, memberPwd, memberName, memberBirthday); //데이터베이스에 정보 추가 }