0
I cannot take the data from the Pesqvendor form and put it in the formCadastroProdu
My project is in C# Windows Forms in 4 layers.
did so
frmCasters
private void pctLocalizaFornecedor_Click(object sender, EventArgs e)
{
frmPesquisarFornecedor pesqFornec = new frmPesquisarFornecedor();
pesqFornec.Show(this);
}
frmPesquisarFornecedor
public partial class frmPesquisarFornecedor : Form
{
private Form codFornec;
public frmPesquisarFornecedor()
{
InitializeComponent();
}
public frmPesquisarFornecedor(Form codFornec)
{
InitializeComponent();
this.codFornec = codFornec;
}
private void frmPesquisarFornecedor_Load(object sender, EventArgs e)
{
CarregaGrid();
}
private void CarregaGrid()
{
try
{
IList<FornecedorDTO> listaFornecDTO = new List<FornecedorDTO>();
listaFornecDTO = new FornecedorModel().CargaFornecedor();// Cria uma estancia do Objeto UsuarioModel
dgvFornecedor.AutoGenerateColumns = false;// Não vai gerar colunas automaticamente
dgvFornecedor.DataSource = listaFornecDTO;// carrega o meu grid DataSource ListaUsuarioDTO
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
#endregion
private void frmPesquisarFornecedor_FormClosed(object sender, FormClosedEventArgs e)
{
// Não sei o que colocar AQUI ??????
}
}
}
needed to load the selected vendor into frmCadastroPecas
I’m not able to get him to press frmCadastroPecas it shows supplier Cod 0 someone would have some solution
thank you
has yes face. You have two cool ways of doing: 1: You can create a new form (aspx) that when the guy clicks on the search button, open that popup. You’ll be chatting with the bottom screen by Session, for example. 2: Another way, which I think is best, to create a usercontrol. This can be opened by modal (it would be nice for you to use bootstrap). If you didn’t understand anything I said, unfortunately you will need to look for an example on the internet to know how to do it...
– Levy Furst Neto
This is simple, creates screen with gridView, in the event form_load you load all suppliers, in the event of the click of the grid you take the data of the provider and click on the previous screen, that is the basic explanation. Be it case go trying to do and posting the doubts of each step.
– DouglasMendes
If the answer helped you, please mark it
– Rovann Linhalis