public TokensEventFields[] loadAllTokenEventFields(long tokenEventID, string firstItem, int pageSize, int pageDirection, out int totRows) { totRows = -1; IDbCommand _cmd = null; IDataReader _dr = null; List <TokensEventFields> _tokensEventsFields = new List <TokensEventFields>(); TokensEventFields[] result; try { base.ConnectionString = DBConnectionString.ExpandSecureBusiness(); _cmd = base.CreateCommand("TokenEventsFields", CommandType.StoredProcedure); _cmd.Parameters.Add(base.AddParameter("@Param0", tokenEventID)); base.Connection.Open(); _dr = _cmd.ExecuteReader(CommandBehavior.CloseConnection); while (_dr.Read()) { _tokensEventsFields.Add(TokensEventFields.loadTokensEventFields((long)_dr[0], (DateTime)_dr[1], (string)_dr[2], (string)_dr[3])); } result = _tokensEventsFields.ToArray(); } catch (Exception ex) { SAFLOGGER.Write(SAFLOGGER.LOGGEREventID.EXCEPTION, "SAFBUSINESS", new string[] { "http://sfexpand.SAFBusiness.TokenBusinessDAO.softfinanca.com/", Assembly.GetExecutingAssembly().FullName.ToString(), ex.ToString() }); result = null; } finally { if (_dr != null) { _dr.Dispose(); } if (_cmd != null) { _cmd.Dispose(); } base.CloseConnection(); } return(result); }
public OperationResult deleteEvent(string tokenEventID) { IDbCommand _cmd = null; IDbCommand _cmdFlds = null; OperationResult result; try { base.ConnectionString = DBConnectionString.ExpandSecureBusiness(); _cmd = base.CreateCommand("TokenEventsDelete", CommandType.StoredProcedure); _cmdFlds = base.CreateCommand("TokenEventsFieldsDelete", CommandType.StoredProcedure); _cmd.Parameters.Add(base.AddParameter("@param0", tokenEventID)); _cmdFlds.Parameters.Add(base.AddParameter("@param0", tokenEventID)); base.Connection.Open(); _cmdFlds.ExecuteNonQuery(); result = ((_cmd.ExecuteNonQuery() != 0) ? OperationResult.Success : OperationResult.Error); } catch (Exception ex) { SAFLOGGER.Write(SAFLOGGER.LOGGEREventID.EXCEPTION, "SAFBUSINESS", new string[] { "http://sfexpand.SAFBusiness.TokenBusinessDAO.softfinanca.com/", Assembly.GetExecutingAssembly().FullName.ToString(), ex.ToString() }); result = OperationResult.Error; } finally { if (_cmdFlds != null) { _cmdFlds.Dispose(); } if (_cmd != null) { _cmd.Dispose(); } base.CloseConnection(); } return(result); }
public TokensEvents[] loadAllEvents(DateTime dateInitial, DateTime dateFinal, string tokenParamsID, string operationID, string tokenID, string applicationUser, string eventOperationStatus, string firstItem, int pageSize, int pageDirection, out int totRows) { totRows = -1; IDbCommand _cmd = null; TokensEvents[] result; try { base.ConnectionString = DBConnectionString.ExpandSecureBusiness(); _cmd = base.CreateCommand("GetTokensEventsPAG", CommandType.StoredProcedure); _cmd.Parameters.Add(base.AddParameter("@InitialDate", dateInitial)); _cmd.Parameters.Add(base.AddParameter("@FinalDate", dateFinal)); _cmd.Parameters.Add(base.AddParameter("@TokenParamsID", tokenParamsID)); _cmd.Parameters.Add(base.AddParameter("@EventOperationID", operationID)); _cmd.Parameters.Add(base.AddParameter("@TokenID", tokenID)); _cmd.Parameters.Add(base.AddParameter("@ApplicationUser", applicationUser)); _cmd.Parameters.Add(base.AddParameter("@EventOperationStatus", eventOperationStatus)); this._PrepPagination(_cmd, int.Parse(firstItem), pageSize, pageDirection); result = this._loadBusinessEvents(_cmd, out totRows); } catch (Exception ex) { SAFLOGGER.Write(SAFLOGGER.LOGGEREventID.EXCEPTION, "SAFBUSINESS", new string[] { "http://sfexpand.SAFBusiness.TokenBusinessDAO.softfinanca.com/", Assembly.GetExecutingAssembly().FullName.ToString(), ex.ToString() }); result = null; } finally { if (_cmd != null) { _cmd.Dispose(); } base.CloseConnection(); } return(result); }
public OperationResult loadDeployEventInfo(string deployEventID, out DataTable dataTable) { DataSet _ds = new DataSet("EventDeploy"); IDbCommand _cmd = null; OperationResult result; try { base.ConnectionString = DBConnectionString.ExpandSecureBusiness(); _cmd = base.CreateCommand("GetTokenIdByEventDeploy", CommandType.StoredProcedure); _cmd.Parameters.Add(base.AddParameter("@param0", deployEventID)); base.CreateDataAdapter(_cmd).Fill(_ds); dataTable = _ds.Tables[0]; result = OperationResult.Success; } catch (Exception ex) { SAFLOGGER.Write(SAFLOGGER.LOGGEREventID.EXCEPTION, "SAFBUSINESS", new string[] { "http://sfexpand.SAFBusiness.TokenBusinessDAO.softfinanca.com/", Assembly.GetExecutingAssembly().FullName.ToString(), ex.ToString() }); dataTable = null; result = OperationResult.Error; } finally { if (_cmd != null) { _cmd.Dispose(); } if (_ds != null) { _ds.Dispose(); } base.CloseConnection(); } return(result); }
public OperationResult insertTokenEvent(string tokenID, int eventOperation, int eventOperationStatus, string applicationUser, out long tokenEventID) { tokenEventID = -1L; IDbCommand _cmd = null; OperationResult result; try { base.ConnectionString = DBConnectionString.ExpandSecureBusiness(); _cmd = base.CreateCommand("TokenEventsInsert", CommandType.StoredProcedure); _cmd.Parameters.Add(base.AddParameter("@param1", tokenID)); _cmd.Parameters.Add(base.AddParameter("@param2", eventOperation)); _cmd.Parameters.Add(base.AddParameter("@param3", (byte)eventOperationStatus)); _cmd.Parameters.Add(base.AddParameter("@param4", applicationUser)); base.Connection.Open(); tokenEventID = long.Parse(_cmd.ExecuteScalar().ToString()); result = ((0L != tokenEventID) ? OperationResult.Success : OperationResult.Error); } catch (Exception ex) { SAFLOGGER.Write(SAFLOGGER.LOGGEREventID.EXCEPTION, "SAFBUSINESS", new string[] { "http://sfexpand.SAFBusiness.TokenBusinessDAO.softfinanca.com/", Assembly.GetExecutingAssembly().FullName.ToString(), ex.ToString() }); result = OperationResult.Error; } finally { if (_cmd != null) { _cmd.Dispose(); } base.CloseConnection(); } return(result); }