0
I’m working with a screen "Financial" and another screen "Financial Report". For the Financial screen, I created an Enum with the options "Accounts Payable and Receivables".
public enum FinanceiroTipo
{
[Description("CONTAS A PAGAR")]
ContasPagar = 1,
[Description("CONTAS A RECEBER")]
ContasReceber = 2
}
I would like to reuse the Financial Reporting Systemmodel for the Financial Reporting screen (because I don’t see the need to duplicate Enumerators), but on the Financial Reporting screen I need to have an extra enumerator, with 3 Numerators in total: "All, Accounts Payable and Accounts Receivable".
I tried to inherit, but in C#, this is not possible to be done with Numerators.
Would anyone have any good practice tips to solve my problem? Thank you!
Either they are the same or they are not. DRY is not to avoid repetition: https://answall.com/q/120931/101
– Maniero
But what’s wrong with having Enum with 3 values?
– João Martins
is that in the registration screen the OTHER should not appear, because it is specific to report.
– Master JR
Todos
are not a type of financial transaction, so under no circumstances should it be included in EnumFinanceiroTipo
if you want to use an Enum to populate the filter on the report screen create a newFinanceiroTipoFiltro
with the options you want. Or because it is just a display item, you can enjoyFinanceiroTipo
and add the item in the checkboxTodos
and do the treatment so that when this option is selected, simply do not filter by the type of operation in your query.– Leandro Angelo
@Leandroangelo Good suggestion!
– Master JR