/*���ܼ�飄1�7
*��TXT���ڹ�ʻ���TxtManager���ID�����Դ�TXT��4ȡ�ù�ʻ��ı��ᅣ1�7
*/
package realcix20.guis.utils;
import java.sql.ResultSet;
import realcix20.utils.DAO;
import realcix20.utils.GlobalValueManager;
import realcix20.utils.Resources;
public class TxtManager {
//���TXTID��ָ������4ȡ�ù�ʻ��ı��ᅣ1�7
public static String getTxt(String txtId, String lang) {
String txt = txtId;
final DAO dao = DAO.getInstance();
dao.query(Resources.SELECT_TXT_TABLE_SQL);
dao.setString(1, txtId);
dao.setString(2, lang);
ResultSet rs = dao.executeQuery();
try {
if (rs.next()) {
txt = rs.getString("LONG");
} else {
dao.query(Resources.SELECT_TXT_TABLE_SQL);
dao.setString(1, txtId);
dao.setString(2, "EN");
rs = dao.executeQuery();
if (rs.next()) {
txt = rs.getString("LONG");
}
}
rs.close();
} catch (Exception e) {
e.printStackTrace();
}
return txt;
}
//���TXTID��ϵͳ����4ȡ�ù�ʻ��ı��ᅣ1�7
public static String getTxt(String txtId) {
String txt = getTxt(txtId, GlobalValueManager.getApplicationLang());
return txt;
}
}