// 예약 추가시 free 업데이트 public bool SetRoomFree(int number, string free) { connection.openConnection(); SqlCommand sql = new SqlCommand("UPDATE Rooms SET free = '" + free + "' Where roomNumber = " + number, connection.getConnection()); if (sql.ExecuteNonQuery() == 1) { connection.closeConnection(); return(true); } else { connection.closeConnection(); return(false); } }
// CLIENTSINFO 테이블에 Insert public bool InsertClient(string firstName, string lastName, string email, string phone, string country) { connection.openConnection(); SqlCommand sql = new SqlCommand("Insert into CLIENTSINFO values('" + firstName + "', '" + lastName + "', '" + email + "', '" + phone + "', '" + country + "')", connection.getConnection()); if (sql.ExecuteNonQuery() == 1) { connection.closeConnection(); return(true); } else { connection.closeConnection(); return(false); } }
// 예약 추가 public bool AddReservation(int roomNum, int clientId, string dateIn, string dateOut) { connection.openConnection(); SqlCommand sql = new SqlCommand("Insert into Reservations (roomNumber, clientId, DateIn, DateOut) values(" + roomNum + ", " + clientId + ", '" + dateIn + "', '" + dateOut + "')", connection.getConnection()); if (sql.ExecuteNonQuery() == 1) { connection.closeConnection(); return(true); } else { connection.closeConnection(); return(false); } }