-2
My project has 3 layers, DAL, BLL, Project utilizo ASP.NET
I have an aspx page in the project, which has textbox containing new values for a database update.
In the DAL class I have Entity that automatically created Gets and Sets
My doubt and the following as I pass values to the class.
Because I always passed values via get and set, but here it is already using get.
DALUsuario.Nome = AQUI QUE GOSTARIA DE RECEBER O VALOR DO TEXTBOX
Class to Update.
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();
}
Page ASPX
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"]));
}
your question became too vague, I could not understand what you really want. Do you want to use the get/set? update data? retrieve values from textbox? MVC or Webform?
– Dorathoto
@Dorathoto Thanks for the first answer I edited the question for better understanding of all, even of those who have this doubt in the future.
– Edgar
Much improved, but I still can not help, put an example of what you are doing, page, etc.
– Dorathoto
@Dorathoto I ended up solving the problem, edited the question with the answer.
– Edgar
correct would be to answer your own question and mark it as the correct one. and not modify the question itself.
– Dorathoto
@Dorathoto Done.! Thank you.
– Edgar
Possible duplicate of Layered communication
– Marco Souza