public TEXCSITRAuthentication(ConnString enumConnString, int intSessionTimeoutMins) { SessionTimeOutMins = intSessionTimeoutMins; this.SQLConn = new System.Data.SqlClient.SqlConnection(); switch (enumConnString) { case ConnString.TEST: this.SQLConn.ConnectionString = TEXCSDBUtil.DBGetConnectionStr(EXCSDBUtil.TEXCSDBUtil.enmdb_EXDBApplUser.db_EXSQL06_TEMP3_EX_Itr_Authenticator_itr_user); // TEXCSDBUtil.C_CONSTR_ITR_EXSQL06_TEMP3; break; case ConnString.EX: this.SQLConn.ConnectionString = TEXCSDBUtil.DBGetConnectionStr(EXCSDBUtil.TEXCSDBUtil.enmdb_EXDBApplUser.db_EXSQL06_EX_Itr_Authenticator_itr_user); //TEXCSDBUtil.C_CONSTR_ITR_EXSQL06_EX; break; default: this.SQLConn.ConnectionString = TEXCSDBUtil.DBGetConnectionStr(EXCSDBUtil.TEXCSDBUtil.enmdb_EXDBApplUser.db_EXSQL06_TEMP3_EX_Itr_Authenticator_itr_user); // TEXCSDBUtil.C_CONSTR_ITR_EXSQL06_TEMP3; break; } this.SQLCmd = new System.Data.SqlClient.SqlCommand(); this.SQLCmd.CommandType = CommandType.StoredProcedure; this.SQLCmd.Connection = this.SQLConn; this.SQLConn.Open(); }
private void DBDeleteRank(int intRankTypeID) { using (SqlCommand sqcmCommand = TEXCSDBUtil.DBStoredProcExecNonQuery(sqcnMain, "dbo.sp_SW_DeleteRank", new string[] { "@intRankTypeID" }, new object[] { intRankTypeID })) { } }
private void InitLocals() { sqcm_NewQuery = TEXCSDBUtil.DBCreateSimpleStoredProc(TSWDB_Decl.GetSQLConSW(), "dbo.sp_SW_NewQuery"); //xxxx /*sp_SW_NewQuery ( @intSearchMethodType as tinyint, @strOriginalQyery as nvarchar(500) , * @strProcessedQuery as nvarchar(500) , @intUserAA as int, @intQueryAA as integer output) AS*/ dsQueryResult = CreateQueryResultsSchema(); }
public TSWDB_WordProcCommand(TEXCSDBUtil.DBLGDatabaseLogin _dbgLogin, IProcessReport _procReport, int _intURLsAtEveryStep, int _intMiliSecsToDelayAfterEveryStep) { intURLsAtEveryStep = _intURLsAtEveryStep; intMiliSecsToDelayAfterEveryStep = _intMiliSecsToDelayAfterEveryStep; processReport = _procReport; //processReport.ShowReporter(); SQLConSW = TEXCSDBUtil.CreateSqlConnection(_dbgLogin); }
public virtual int GetNumberOfOutLinks(int intURLID) { using (SqlCommand sqcmNumberOfInLinks = TEXCSDBUtil.DBStoredProcPrepare(sqcnMain, "dbo.sp_SW_SelectNumberOfOutLinks", new string[] { "@intURLID" }, new object[] { intURLID })) { return((int)sqcmNumberOfInLinks.ExecuteScalar()); } }
//public delegate void Report(string strReport); DataSet GetNextURLs() { Report(string.Format("----- Trying to get the next {0} Urls -----", intStepUrls)); DataSet dsetURLS = TEXCSDBUtil.DBStoredProcExecDataSet(sqcnMain, "dbo.sp_SW_SelectGreekURLIDs", new string[] { "@intFromURLID", "@intToURLID" }, new object[] { intLastUrlAsked + 1, intLastUrlAsked + intStepUrls }); intLastUrlAsked += intStepUrls; Report(string.Format("----- Succesfully got {0} Urls. Tried to get {1} Urls -----", dsetURLS.Tables[0].Rows.Count, intStepUrls)); return(dsetURLS); }
static DataSet CreateQueryResultsSchema() { DataSet dsResult = TEXCSDBUtil.CreateSimpleTable(CQryResDataSet, CQryResTable, new TStringTypeElement(CQryResField_ShowOrder, typeof(int)), new TStringTypeElement[] { new TStringTypeElement(CQryResField_QueryDetailAA, typeof(int)), new TStringTypeElement(CQryResField_QueryID, typeof(int)), new TStringTypeElement(CQryResField_URLId, typeof(int)), new TStringTypeElement(CQryResField_URL, typeof(string)), new TStringTypeElement(CQryResField_PageView, typeof(string)), new TStringTypeElement(CQryResField_PercentSuccess, typeof(decimal)) }); dsResult.Tables[0].DefaultView.ApplyDefaultSort = true; return(dsResult); }
static DataSet CreateSWDB_SearchTableWordsSchema() { DataSet dsResult = TEXCSDBUtil.CreateSimpleTable(CSWDB_Search_DataSet, CSWDB_Search_Table, new TStringTypeElement(CSWDB_Search_Word, typeof(string)), new TStringTypeElement[] { new TStringTypeElement(CSWDB_Search_WordAA, typeof(int)) }); dsResult.Tables[0].DefaultView.ApplyDefaultSort = true; return(dsResult); /*DataTable dttbResult = new DataTable(CTPSplitTable); * DataColumn pkCol = dttbResult.Columns.Add(CTPSplitField_Word, typeof(string)); * dttbResult.PrimaryKey = new DataColumn[] {pkCol}; * dttbResult.Columns.Add(CTPSplitField_CountWord, typeof(int)); * DataSet dsResult = new DataSet(CTPSplitDataSet); * dsResult.Tables.Add(dttbResult); * return dsResult;*/ }
protected float DBGetRank(int intRankTypeID, int intURLID, float dcmDefaultValue, out bool blnFoundDBValue) { float dcmResult = dcmDefaultValue; byte intFoundRankValue = 0; blnFoundDBValue = false; using (SqlCommand sqcmCommand = TEXCSDBUtil.DBStoredProcExecNonQuery(sqcnMain, "dbo.sp_SW_SelectRank", new string[] { "@intRankTypeID", "@intURLID", "@numRank", "@intFoundRankValue" }, new object[] { intRankTypeID, intURLID, dcmResult, intFoundRankValue })) { if ((byte)(sqcmCommand.Parameters["@intFoundRankValue"].Value) == 1) { dcmResult = (float)((decimal)sqcmCommand.Parameters["@numRank"].Value); blnFoundDBValue = true; } } return(dcmResult); }
//--------------------------------------------------------------------------------------- public ArrayList GetGreekOutLinks(int intURLID) { ArrayList arlsResult = new ArrayList(); using (DataSet dsetURLS = TEXCSDBUtil.DBStoredProcExecDataSet(sqcnMain, "dbo.sp_SW_SelectGreekOutLinks", new string[] { "@intURLID" }, new object[] { intURLID })) { if ((dsetURLS != null) && (dsetURLS.Tables[0] != null) && (dsetURLS.Tables[0].Rows.Count > 0)) { foreach (DataRow dtrwIter in dsetURLS.Tables[0].Rows) { arlsResult.Add((int)dtrwIter["cwlg_to_url_id"]); } } } return(arlsResult); }
protected void DBUpdateRank(int intRankTypeID, int intURLID, float dcmRank) { float dcmOldValue = 0.0f; int intFoundRankOldValue = 0; using (SqlCommand sqcmCommand = TEXCSDBUtil.DBStoredProcExecNonQuery(sqcnMain, "dbo.sp_SW_UpdateRank", new string[] { "@intRankTypeID", "@intURLID", "@numRank", "@numRankOldValue", "@intFoundRankOldValue" }, new object[] { intRankTypeID, intURLID, (decimal)dcmRank, dcmOldValue, intFoundRankOldValue })) { if ((byte)sqcmCommand.Parameters["@intFoundRankOldValue"].Value == 1) { try { dcmOldValue = (float)((decimal)sqcmCommand.Parameters["@numRankOldValue"].Value); } catch { dcmOldValue = float.MinValue; } } } if (dcmOldValue < float.MinValue + 1) { // blnFoundURlWithoutRank=true; intNumUrlsThatFoundDifferenceInPrecisionDigits++; return; } if (HasSignificantDifference(dcmOldValue, dcmRank)) { intNumUrlsThatFoundDifferenceInPrecisionDigits++; return; } return; }
public TSWDB_Authenticator() { sqcm_CheckUser = TEXCSDBUtil.DBCreateSimpleStoredProc(TSWDB_Decl.GetSQLConSW(), "dbo.sp_SW_CheckUser"); sqcm_NewUser = TEXCSDBUtil.DBCreateSimpleStoredProc(TSWDB_Decl.GetSQLConSW(), "dbo.sp_SW_NewUser"); }