private void PopularDgvCliente() { ServicoPLA servicoPLA = new ServicoPLA(); var retorno = servicoPLA.ListarCliente(); dgvCliente.DataSource = retorno.Item2; }
private void ListarCliente() { ServicoPLA servicoPLA = new ServicoPLA(); var retorno = servicoPLA.ListarCliente(); if (retorno.Item2.Rows.Count != 0) { int aux = 0; while (retorno.Item2.Rows.Count != aux) { cbxCliente.Items.Add(retorno.Item2.Rows[aux]["Nome"].ToString()); aux++; } } }
private int GetReferencialClienteSelecionado(string nome) { ServicoPLA servicoPLA = new ServicoPLA(); var retorno = servicoPLA.ListarCliente(); int referencialClienteSelecionado = 0; if (retorno.Item2.Rows.Count != 0) { int contador = 0; while (retorno.Item2.Rows.Count != contador) { if (nome == retorno.Item2.Rows[contador]["Nome"].ToString()) { string aux = retorno.Item2.Rows[contador]["Referencial"].ToString(); referencialClienteSelecionado = int.Parse(aux); return(referencialClienteSelecionado); } contador++; } } return(0); }