/// <summary> /// 사용자의 RSS사이트 조회 /// </summary> public System.Data.DataSet selectRSSsite(string user_id) { System.Data.DataSet DS = new System.Data.DataSet(); System.Data.SqlClient.SqlConnection dbCon; string QUERY = "SELECT idx, RSS_name, RSS_url FROM tb_RSSsite WHERE user_id='" + user_id + "' AND RSS_state='AA'"; dbCon = objDB.GetConnection(); DS = objDB.ExecuteDSQuery(dbCon, QUERY); dbCon.Close(); return(DS); }
public System.Data.DataSet LeftMenu(System.Data.SqlClient.SqlConnection dbCon, string user_id) { System.Data.DataSet DS = new System.Data.DataSet(); StringBuilder strBuilder = new StringBuilder(); string Result = "FAIL"; strBuilder.Append("SELECT "); strBuilder.Append(" RSS_name,RSS_url, idx from tb_RSSsite WHERE user_id ='" + user_id + "' AND RSS_state='AA'"); try { DS = objDB.ExecuteDSQuery(dbCon, strBuilder.ToString()); //리스트 출력시 로그파일 기록 objUtil.writeLog("GET LeftMenu QUERY : " + strBuilder.ToString()); } catch (Exception e) { Result = "FAIL"; objUtil.writeLog("FAIL LeftMenu : " + user_id); } return(DS); }
/// <summary> /// 실패시 FAIL 리턴 /// </summary> public static string getNewID(System.Data.SqlClient.SqlConnection dbCon, System.Data.SqlClient.SqlTransaction TRX, string tbName, string kcol, string Wcols, string Wvals, int len) { StringBuilder strBuilder = new StringBuilder(); DataSet DS = new DataSet(); string Result = "FAIL"; string dKey = "".PadLeft(len, '0'); int i; ArrayList arrWCols = new ArrayList(); ArrayList arrWVals = new ArrayList(); arrWCols.AddRange(objUtil.Split(Wcols, "|")); arrWVals.AddRange(objUtil.Split(Wvals, "|")); strBuilder.Append("SELECT ISNULL(MAX(" + kcol + "), '" + dKey + "') FROM " + tbName); strBuilder.Append(" WHERE 1 = 1"); for (i = 0; i < arrWCols.Count; i++) { if (arrWCols[i].ToString().Length > 0) { strBuilder.Append(" AND "); strBuilder.Append("["); strBuilder.Append(objUtil.ToDb(arrWCols[i].ToString())); strBuilder.Append("]"); strBuilder.Append(" = "); strBuilder.Append("'"); strBuilder.Append(objUtil.ToDb(arrWVals[i].ToString())); strBuilder.Append("'"); } } objUtil.writeLog("GET NEW ID QUERY : " + strBuilder.ToString()); DS = objDB.ExecuteDSQuery(dbCon, TRX, strBuilder.ToString()); if (validateDS(DS)) { Result = (objUtil.ToInt32(DS.Tables[0].Rows[0][0].ToString()) + 1).ToString().PadLeft(len, '0'); } objUtil.writeLog("GET NEW ID : " + Result); return(Result); }
/// <summary> /// 로그인 정보 일치하면 SUCCESS, 실패나 오류는 FAIL 리턴 /// </summary> public string userAuth(System.Data.SqlClient.SqlConnection dbCon, string user_id, string passwd) { System.Data.DataSet DS = new System.Data.DataSet(); string QUERY = "SELECT COUNT(*) FROM tb_user WHERE user_id='" + user_id + "' AND passwd='" + passwd + "'"; string Result = "FAIL"; try { DS = objDB.ExecuteDSQuery(dbCon, QUERY); if (DS.Tables[0].Rows[0][0].ToString().Equals("1")) { Result = "SUCCESS"; } } catch (Exception e) { Result = "FAIL"; objUtil.writeLog("FAIL USER AUTHENTICATION : " + user_id); } return(Result); }
private bool isDupeURL(System.Data.SqlClient.SqlConnection dbCon, System.Data.SqlClient.SqlTransaction TRX, string longURL) { libCommon.clsDB objDB = new libCommon.clsDB(); System.Data.DataSet DS = new System.Data.DataSet(); string QUERY = "SELECT COUNT(*) FROM tb_URL WHERE longURL='" + longURL + "'"; DS = objDB.ExecuteDSQuery(dbCon, TRX, QUERY); if (libMyUtil.clsCmnDB.validateDS(DS)) { return(true); } else { return(false); } }
/// <summary> /// RSS사이트의 idx를 설정(title, url필요) /// </summary> /// <param name="user_id"></param> public void setSiteIdx(string user_id) { System.Data.DataSet DS = new System.Data.DataSet(); System.Data.SqlClient.SqlConnection dbCon; string QUERY = "SELECT idx FROM tb_RSSsite WHERE user_id='" + user_id + "' AND RSS_name='" + objUtil.toDb(siteTitle) + "' AND RSS_url='" + siteURL + "' AND RSS_state='AA'"; dbCon = objDB.GetConnection(); DS = objDB.ExecuteDSQuery(dbCon, QUERY); dbCon.Close(); if (objCmnDB.validateDS(DS)) { idx = DS.Tables[0].Rows[0][0].ToString(); } else { idx = ""; } }