0
I have an application with the form FormFuncionario
. I wish to inherit all the features of this form for a second class, called ControlFuncionario
, where it will be responsible for holding various events, and, including, access the database. I was taught that I should not leave the logic and the part of database directly in the layer GUI, so I created another call BLL and tried to apply the following code :
namespace BLL.Pessoal // Camada/Pasta que está localizada a classe
{
class ControlFuncionario : GUI.FormFuncionario //Aponta erro
{
}
}
The error is as follows :
CS0012 C# The type 'Form' is defined in an Assembly that is not referenced. You must add a Reference to Assembly.
My question is how I inherit this form for a "common class" ...
creates an empty form first, then changes the
: Form
for: GUI.FormFuncionario
– Rovann Linhalis
If the
FormFuncionario
is in the ProjectGUI
andclass ControlFuncionario
is in the BLL project, vc have to add BLL GUI reference, to have access to content.– Paulo Ricardo
Are you sure to bring a GUI form as a reference to your BLL? The correct one would be the opposite. And in BLL provide all the methods necessary to run the form... Now your GUI is a Windows.Form... Tomorrow can be a MVC, Web.Api and etc... It would not make sense, right? Including your BLL should also not directly access the database...
– Leandro Angelo