public ChartOfAccount Map(ChartOfAccountsData chart_of_accounts_data) { return(new ChartOfAccount() { ChartOfAccountKey = chart_of_accounts_data.CoaKey, CompanyKey = chart_of_accounts_data.CompanyKey, AccountNo = chart_of_accounts_data.AcctNo, AccountType = chart_of_accounts_data.AcctType, AccountName = chart_of_accounts_data.AcctName, BalanceType = chart_of_accounts_data.BalanceType, BankAccountFlag = chart_of_accounts_data.BankAcctFlg, AddedUserID = chart_of_accounts_data.AuditAddUserId, AddedDateTime = chart_of_accounts_data.AuditAddDatetime, UpdateUserID = chart_of_accounts_data.AuditUpdateUserId, UpdateDateTime = chart_of_accounts_data.AuditUpdateDatetime, }); }
} // Map function closer public List <SqlParameter> MapParamsForUpsert(ChartOfAccountsData entity) { var sql_params = new List <SqlParameter>(); sql_params.Add(new SqlParameter("@coa_key", entity.CoaKey)); sql_params.Add(new SqlParameter("@company_key", entity.CompanyKey)); sql_params.Add(new SqlParameter("@acct_no", entity.AcctNo)); sql_params.Add(new SqlParameter("@acct_type", entity.AcctType)); //sql_params.Add(new SqlParameter("@department_no", entity.DepartmentNo)); //sql_params.Add(new SqlParameter("@lob_no", entity.LobNo)); sql_params.Add(new SqlParameter("@acct_name", entity.AcctName)); sql_params.Add(new SqlParameter("@balance_type", entity.BalanceType)); sql_params.Add(new SqlParameter("@bank_acct_flg", entity.BankAcctFlg)); //sql_params.Add(new SqlParameter("@report", entity.Report)); sql_params.Add(GetOutParam()); return(sql_params); }
public ChartOfAccount GetChartOfAccountByID(int chart_of_accounts_key) { Log.Info("Accessing ChartOfAccountBusinessEngine GetChartOfAccountByID function"); return(ExecuteFaultHandledOperation(() => { ChartOfAccountsData chart_of_accounts_data = _chart_of_accounts_repo.GetByID(chart_of_accounts_key); Log.Info("ChartOfAccountBusinessEngine GetByID function completed"); if (chart_of_accounts_data.CoaKey != 0) { var chart_of_accounts = _chart_of_accounts_es.Map(chart_of_accounts_data); return chart_of_accounts; } else { NotFoundException ex = new NotFoundException($"ChartOfAccount with key {chart_of_accounts_key} is not in database"); throw new FaultException <NotFoundException>(ex, ex.Message); } })); }
public List <SqlParameter> MapParamsForDelete(ChartOfAccountsData entity) { return(MapParamsForDelete(entity.CoaKey)); }