public Task <List <vh_expense_transC> > GetAllExpensesByMonthPartition(dto_month_partitionC _dto) { List <vh_expense_transC> _list = null; string _sql = null; try { using (var _db = fnn.GetDbConnection()) { if (_dto.fs_timestamp == 0) { _sql = string.Format("select * from {0} where m_partition_id = {1} and delete_id = 0", _table_name.ToDbSchemaTable(), _dto.m_partition_id); _list = _db.Query <vh_expense_transC>(_sql).ToList(); } else { _sql = string.Format("select * from {0} where m_partition_id = {1} and fs_timestamp > {2}", _table_name.ToDbSchemaTable(), _dto.m_partition_id, _dto.fs_timestamp); _list = _db.Query <vh_expense_transC>(_sql).ToList(); } } } catch (SqlException ex) { LoggerX.LogException(ex); } catch (DbException ex) { LoggerX.LogException(ex); } catch (Exception ex) { LoggerX.LogException(ex); } return(Task.FromResult(_list)); }
public Task <List <creditor_depositC> > GetAllCreditorDepositsByMonthPartition(dto_month_partitionC _dto) { List <creditor_depositC> _list = null; string _sql = null; try { using (var _db = fnn.GetDbConnection()) { if (_dto.fs_timestamp == 0) { _sql = string.Format("select * from {0} where m_partition_id = {1} and delete_id = 0", FleetManager.DbBase.tableNames.creditor_deposit_tb.ToDbSchemaTable(), _dto.m_partition_id); _list = _db.Query <creditor_depositC>(_sql).ToList(); } else { _sql = string.Format("select * from {0} where m_partition_id = {1} and fs_timestamp > {2}", FleetManager.DbBase.tableNames.creditor_deposit_tb.ToDbSchemaTable(), _dto.m_partition_id, _dto.fs_timestamp); _list = _db.Query <creditor_depositC>(_sql).ToList(); } } } catch (SqlException ex) { LoggerX.LogException(ex); } catch (DbException ex) { LoggerX.LogException(ex); } catch (Exception ex) { LoggerX.LogException(ex); } return(Task.FromResult(_list)); }