public void adminLogin() { Console.Clear(); share.getDisplay().loginDisplay("Administrator Login"); //Console.SetCursorPosition(22, 6); inputId = share.getException().loginId(); Console.SetCursorPosition(22, 10); inputPwd = share.getException().inputpwd(); if (inputId == "admin") { if (inputPwd == "admin") { share.getMenu().adminMenu(); } else { Console.SetCursorPosition(22, 15); Console.WriteLine("접근 불가"); System.Threading.Thread.Sleep(800); } } else { Console.SetCursorPosition(22, 15); Console.WriteLine("접근 불가"); System.Threading.Thread.Sleep(800); } share.getMenu().mainMenu(); }
public string inputIdWhenAdd(string direct) //ID를 입력했을 때 중복이면 입력하지못한다. { while (true) { Console.Write("{0} : ", direct); input = Console.ReadLine(); Regex regex = new Regex(@"^[a-zA-z][a-zA-z0-9]{5,15}$"); Boolean ismatch = regex.IsMatch(input); if (ismatch) { bool IsExistedId = share.getMemberTable().IsIdDuplication(input); if (IsExistedId.Equals(true)) { Console.WriteLine("\t\t존재하는 ID입니다."); } else if (IsExistedId.Equals(false)) { break; } } else if (input == "back") { Console.Clear(); share.getMenu().mainMenu(); } else if (!ismatch) { Console.WriteLine("ID는 영문자로 시작하여 숫자를 포함할 수 있으며(한글 및 특수문자 제외), 6자리 이상 16자리 이하입니다."); } } return(input); }
public void rentBook() //대출 { share.getBookTable().booksAllSearchOfDB(); Console.WriteLine("\n\n\t목록을 보고 빌리고 싶은 No와 책 이름을 입력해주세요"); bookNo = share.getException().checkNoWhenRent(); bookName = share.getException().checkNameNo(bookNo); int cnt = share.getRentTable().rentCount(share.getLoginId()); if (cnt <= 3) //3권 만 빌릴 수 있다 대출 제한 { share.getBookTable().changeRenting("대출 불가능", bookNo); share.getRentTable().addRentTable(bookNo, bookName); cnt++; } else if (cnt > 3) { Console.Clear(); Console.WriteLine("\n\n\n\n"); Console.WriteLine("\t 대출은 최대 3권까지만 가능합니다."); System.Threading.Thread.Sleep(800); share.getMenu().menuOnLogin(); } }