0
I am working on the development of a financial program in Windows Forms and a requirement appeared that I am not yet knowing how to do. The requirement is as follows::
On the last day of the month when opening the program for the first time, the same should ask if you want to generate the boletos of all installments to be paid in the following month and if positive, generate these boletos all at once.
The program already has a billet generating mechanism using the Boletonet library. In fact, there is a screen that shows the plots and allows generating the billet for the selected plots. The mechanism is the same, the only difference is that the program would need to take all the installments to be paid the following month and execute the billet generation code on top of them.
So far so good. The problem that exists is the following: how to make the program on the last day of the month show this message only once?
Displaying a message like this on the last day of the month is easy. Simply put a if
that checks if today is the last day of the month and if so opens the window with the question and the options yes and no.
The problem is making that message appear only time. And in fact I think it would even be necessary to have an option: "show later" for the message to be shown again after.
Anyway, the problem is that that would require a sense of state of it. But I think making a table in the database just to store whether that month the window was shown or not is nonsense. It doesn’t even make sense, because that kind of window could be used for more things and then there would be a table for each?
What I want to know is, how can I get this window to be shown once?
Editing: In attention to the comments, I will add this edition to explain a little better. The requirement was presented anyway. And to tell you the truth, it’s hard to get any more explanations. In this project several times I tried to get more explanations about the requirements but in general we did not get much clarification.
Back to the requirement itself: the user asked to open once only on the day. Not to open again we would have to have recorded somewhere that that month was already opened. Hence in memory is not enough.
On the other hand, there are other variables and considerations that made me post the question to evaluate the best way to achieve this. First, this type of interaction must occur for other things. For example, the user wants that on the first day of the month the program opens only once a window asking if he wants to send the boletos generated on the last day of the previous month. Hence the same kind of situation.
In addition, there are variables to consider: (1) and if the user wants to be remembered later? (2) would also need a verification of the existence of parcels to generate billet? (3) and if the user creates a new charge on the same day?
It’s just a few questions that make you consider the need to have a sense of state of this. On the other hand, I thought of using a table for all these types of actions, in an abstract way thinking only of the business rule. Something like this: create a table acoes_periodicas
with columns id
, tipo_acao
, data
, situacao
. The tipo_acao
would discriminate against what is done periodically, e.g., geracao_boleto_mes
, envio_boletos_mes
. The date would contain month information and the situation would contain the information whether it was made or whether it was postponed.
This was just a first idea, but I found it a little strange. The biggest oddity is: the column tipo_acao
would have to have only a few default values that would be hardcoded. That is, when to open the boleto window would make a query in the database explicitly by geracao_boleto_mes
. I think it works, but I think it’s weird. As the situation is more general and can be used in other situations where a program needs to ask a user always on a day of the month to do something, I found valid the question even for other people and posted.
I didn’t understand that:
esse tipo de janela poderia ser usada para mais coisas e aí teria uma tabela para cada?
– Maniero
I removed the UX tag because your question does not fit into this merit. If you did, by the way, it would be too wide. If you also have that doubt, I suggest you open another focused question.
– Luiz Vieira
About the "problem", do not just store some indication in remembrance? After all, the window will only be displayed on the last day of the month (never before, never after). Only during that office hours does it make sense not to show off more than once. If the user closes the system and opens again, you show once more (which, in fact, is even consistent). Obviously you are also already checking whether the billets have already been generated, nay?
– Luiz Vieira
@Luizvieira actually the question is not very clear in the details of the requirement, how the system operates, but it will improve. This is a possible solution and it seems appropriate, but it talks about remembering the state without saying why and when it needs to do this, it may need another solution, and then it may be that a table would not be anything absurd.
– Maniero
@bigown Yes, I agree. So I commented with a question, instead of answering. :)
– Luiz Vieira
Pq does not create a flag in your App.config to see if the message has already been displayed?
– gato
Did the answer resolve what was in doubt? Do you need something else to be improved? Do you think it is possible to accept it now?
– Maniero