// 추가 by 이현석(2011-07-27) public string LeftMenuString(System.Web.SessionState.HttpSessionState Session, clsFeed objFeed) { System.Data.SqlClient.SqlConnection dbCon; System.Data.DataSet siteList_DS = new System.Data.DataSet(); string menu_state = ""; string login_user_name = (string)Session["user_name"]; string login_comp_name = (string)Session["comp_name"]; string login_part_name = (string)Session["part_name"]; libRSSreader.clsLeft objLeft = new libRSSreader.clsLeft(); //로그인 했을때 if ((string)Session["user_id"] != "Not login") { dbCon = objDB.GetConnection(); siteList_DS = objLeft.LeftMenu(dbCon, (string)Session["user_id"]); dbCon.Close(); menu_state = objLeft.DS2Left(siteList_DS, (string)Session["user_id"], objFeed); } else { menu_state = "<a href='javascript:gologin();'>프로그램</a>"; } return(menu_state); }
/// <summary> /// tb_aURLresult 테이블 결과 업데이트 /// </summary> /// <param name="Result">전달받은 결과값</param> private void UpdateResult(libMyUtil.pageCallingInfo callingInfo, string Result) { libCommon.clsDB objDB = new libCommon.clsDB(); System.Data.SqlClient.SqlConnection dbCon; System.Data.SqlClient.SqlTransaction TRX; string updateResult; if (System.Text.Encoding.Default.GetByteCount(Result) > 1000) { Result = Result.Substring(0, 500); } try { dbCon = objDB.GetConnection(); TRX = dbCon.BeginTransaction(); updateResult = libMyUtil.clsCmnDB.UPDATE_DB(dbCon, TRX, "tb_aURLresult", "RESULT", Result, "aURLidx|FKEY", callingInfo.aURLset_Idx + "|" + callingInfo.FKEY); if (updateResult.Equals("FAIL")) { TRX.Rollback(); objUtil.writeLog(string.Format("FAIL UPDATE URL RESULT\r\nFKEY:{0}\r\nResult:{1}", callingInfo.FKEY, Result)); } else { TRX.Commit(); } dbCon.Close(); } catch (Exception ex) { objUtil.writeLog("ERR UPDATE URL CALL RESULT : " + ex.ToString()); } }
/// <summary> /// RSS사이트 인서트, 실패/오류시 FAIL 리턴 /// </summary> public string insertRSSsite(string URL, string user_id) { System.Data.SqlClient.SqlConnection dbCon; System.Data.SqlClient.SqlTransaction TRX; string Cols; string Vals; string flag; string Result = "FAIL"; setSiteInfo(URL); if (siteURL.Trim().Length > 0 && siteTitle.Trim().Length > 0) { Cols = "user_id|RSS_name|RSS_url"; Vals = user_id + "|" + siteTitle + "|" + siteURL; dbCon = objDB.GetConnection(); TRX = dbCon.BeginTransaction(); flag = isDupeSite(dbCon, TRX, user_id, URL); if (flag.Equals("OK")) { Result = objCmnDB.INSERT_DB(dbCon, TRX, "tb_RSSsite", Cols, Vals); } else if (flag.Equals("DUPE")) { Result = toggleSiteState(dbCon, TRX, user_id, URL, "AA"); } if (Result.Equals("FAIL")) { TRX.Rollback(); objUtil.writeLog(string.Format("FAIL INSERT RSS SITE INFO : {0}-{1}({2})", user_id, siteTitle, siteURL)); } else { TRX.Commit(); } dbCon.Close(); } return(Result); }
private void insertData(string fileName, string date, string model, string width, string height) { System.Data.SqlClient.SqlConnection dbCon; System.Data.SqlClient.SqlTransaction TRX; libCommon.clsDB objDB = new libCommon.clsDB(); dbCon = objDB.GetConnection(); TRX = dbCon.BeginTransaction(); libMyUtil.clsCmnDB.INSERT_DB(dbCon, TRX, "tb_EXIFdata", "filePath|fileName|date|model|width|height", fileName + "|" + Path.GetFileName(fileName) + "|" + date + "|" + model + "|" + width + "|" + height); TRX.Commit(); dbCon.Close(); }
private void updateData(string fileName, string data) { System.Data.SqlClient.SqlConnection dbCon; System.Data.SqlClient.SqlTransaction TRX; libCommon.clsDB objDB = new libCommon.clsDB(); dbCon = objDB.GetConnection(); TRX = dbCon.BeginTransaction(); libMyUtil.clsCmnDB.UPDATE_DB(dbCon, TRX, "tb_EXIFdata", "model", data, "filePath", fileName); TRX.Commit(); dbCon.Close(); }
/// <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); }