My project has 3 layers, DAL, BLL, Project I use ASP.NET
I have an aspx page in the project, which has textbox containing new values for an update in the database.
In the DAL class I have entity that automatically created GETs and SETs
My question is the following as I pass values to the class.
I have always passed values via get and set, but here is already using get.
DALUsuario.Nome = AQUI QUE GOSTARIA DE RECEBER O VALOR DO TEXTBOX
Update class.
public void AtualizarUsuario(int idUsuario)
{
TabUsuario DALUsuario = db.TabUsuario.Find(idUsuario);
DALUsuario.Nome = "";
DALUsuario.UsuarioId = "";
DALUsuario.Senha = "";
DALUsuario.Status = true;
DALUsuario.DataCriacao = DateTime.Now;
db.Entry(DALUsuario).State = EntityState.Modified;
db.SaveChanges();
}
ASPX Page
protected void btnEdiUsuario_Click(object sender, EventArgs e)
{
BLLUsuario = Usuario.DALUsuario;
BLLUsuario.Nome = txtNomeUsuario.Text;
BLLUsuario.Email = txtEmailUsuario.Text;
...
Usuario.AtualizarUsuario(Convert.ToInt32(Request.QueryString["Usuario"]));
}