public override IList <IVtRotefMovement> GetRotefList(int month, int year, VtRotefMovementType movementType) { //TODO: Get SqlQuery by movementType string sqlString = ""; var dbc = _db.GetSqlStringCommand(sqlString); dbc.CommandType = CommandType.Text; var startDate = int.Parse($"{year}{month}01"); var endDate = int.Parse($"{year}{month}31"); _db.AddInParameter(dbc, "@StartDate", DbType.Int32, startDate); _db.AddInParameter(dbc, "@EbdDate", DbType.Int32, endDate); var movementList = new List <IVtRotefMovement>(); using (var dataReader = _db.ExecuteReader(dbc)) { while (dataReader.Read()) { movementList.Add(PopulateMovementFromDataRecord(dataReader)); } } return(movementList); }
public abstract IList <IVtRotefMovement> GetRotefMovementList(string month, string year, VtRotefMovementType movementType);
public override IList <IVtRotefMovement> GetRotefMovementList(string month, string year, VtRotefMovementType movementType) { var sqlQueryName = ""; switch (movementType) { case VtRotefMovementType.FromAccounts: sqlQueryName = "GetRotefMovementsFromAccounts.sql"; break; case VtRotefMovementType.FromCredits: sqlQueryName = "GetRotefMovementsFromCredits.sql"; break; } var sqlString = ResourceHelper.GetEmbeddedResource(sqlQueryName); var dbc = _db.GetSqlStringCommand(sqlString); dbc.CommandType = CommandType.Text; var startDate = int.Parse($"{year}{month}01"); var endDate = int.Parse($"{year}{month}31"); _db.AddInParameter(dbc, "@StartDate", DbType.Int32, startDate); _db.AddInParameter(dbc, "@EndDate", DbType.Int32, endDate); var movementList = new List <IVtRotefMovement>(); using (var dataReader = _db.ExecuteReader(dbc)) { while (dataReader.Read()) { movementList.Add(PopulateMovementFromDataRecord(dataReader)); } dataReader.Close(); } return(movementList); }
public abstract IList <IVtRotefMovement> GetRotefList(int month, int year, VtRotefMovementType movementType);