private void SearchConsorcioBtn_Click(object sender, EventArgs e) { if (CuitConsorcio1Txt.Text != "") { string[] ConsorcioData = obj.GetConsorcio(CuitConsorcio1Txt.Text); NameConsorcio1Txt.Text = ConsorcioData[0]; DomConsorcistaTxt.Text = ConsorcioData[1]; ConsorcistaCpTxt.Text = ConsorcioData[2]; } else { MessageBox.Show("Please enter Consorcio CUIT number"); } }
reset_controls obj1 = new reset_controls(); // I create the ob1 globally to call the method later. private void SearchBtn_Click(object sender, EventArgs e) { if (CuitConsorcioTxt.Text != "") { string[] ConsorcioData = obj.GetConsorcio(CuitConsorcioTxt.Text); NameConsorcioTxt.Text = ConsorcioData[0]; DomConsorcioTxt.Text = ConsorcioData[1]; ConsorcioCpTxt.Text = ConsorcioData[2]; CategConsorcioTxt.Text = ConsorcioData[3]; SuthernConsorcioTxt.Text = ConsorcioData[4]; StatusConsorcioTxt.Text = ConsorcioData[5]; } else { MessageBox.Show("Please enter CUIT number"); } }