public void GetAllDates(List <CovidDate> pCovidDateList) { Query oQuery; List <object[]> oResultList = new List <object[]>(); this.SetQuery(_SELECT_DATES_QUERY_PATH, out oQuery); var isAWellResponse = this._oConnection.ExecuteSelectCommand(oQuery.query, oResultList); if (!isAWellResponse || oResultList.Count == UtilsConstants.IntConstants.ZERO) { return; } CovidDate oCovidDate; int numberOfColumns = UtilsConstants.IntConstants.TWO; foreach (var oDateRow in oResultList) { if (oDateRow.Length != numberOfColumns) { continue; } oCovidDate = new CovidDate(); oCovidDate.id = ulong.Parse(oDateRow[UtilsConstants.IntConstants.ZERO].ToString()); oCovidDate.date = oDateRow[UtilsConstants.IntConstants.ONE].ToString(); oCovidDate.dateFormat = UtilsConstants.DateConstants.API_DATE_FORMAT; oCovidDate.dateSeparator = UtilsConstants.StringConstants.RIGHT_BAR; pCovidDateList.Add(oCovidDate); } }
public bool InsertDate(CovidDate pCovidDate) { Query oQuery; this.SetQuery(_INSERT_DATES_QUERY_PATH, out oQuery); this.SetDateQuery(pCovidDate, oQuery); return(oConnectionPostgreSql.ExecuteCommand(oQuery.query)); }
public override bool InsertDate(CovidDate pCovidDate) { ConnectionPostgreSql oConnection; this.SetConnection(out oConnection); _oPostgreSqlInsert = PostgreSqlInsert.GetInstance(oConnection); _oPostgreSqlInsert.InsertDate(pCovidDate); return(true); }
private void SetDateQuery(CovidDate pCovidDate, Query oQuery) { oQuery.valuesFormat = oQuery.valuesFormat.Replace( UtilsConstants.QueryConstants.ZERO_STRING, pCovidDate.id.ToString()).Replace( UtilsConstants.QueryConstants.ONE_STRING, string.Join( string.Empty, UtilsConstants.StringConstants.REPLACE_SINGLEQUOTE_CONSTANT, pCovidDate.date, UtilsConstants.StringConstants.REPLACE_SINGLEQUOTE_CONSTANT)); oQuery.query = oQuery.query.Replace( UtilsConstants.QueryConstants.REPLACE_QUERY_CONSTANT, oQuery.valuesFormat); }
public abstract bool InsertDate(CovidDate pCovidDate);