private void btnTrocarConta_Click(object sender, EventArgs e)
        {
            formConta fconta = new formConta();

            if (fconta.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                _Conta = fconta.pegarConta();
                BrowserTabs.TabPages.Clear();
                atualizarConta();
                //_Imoveis = carregarImoveis();
                downloadImoveis();
            }
        }
Beispiel #2
0
 public ContaDTO pegarConta()
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         ContaDTO conta = new ContaDTO();
         if (dataGridView1.SelectedRows[0].Cells["id_conta"].Value != null)
         {
             conta.IdConta = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["id_conta"].Value);
         }
         if (dataGridView1.SelectedRows[0].Cells["slug"].Value != null)
         {
             conta.Slug = dataGridView1.SelectedRows[0].Cells["slug"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["nome"].Value != null)
         {
             conta.Nome = dataGridView1.SelectedRows[0].Cells["nome"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["telefone1"].Value != null)
         {
             conta.Telefone1 = dataGridView1.SelectedRows[0].Cells["telefone1"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["telefone2"].Value != null)
         {
             conta.Telefone2 = dataGridView1.SelectedRows[0].Cells["telefone2"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["telefone3"].Value != null)
         {
             conta.Telefone3 = dataGridView1.SelectedRows[0].Cells["telefone3"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["telefone4"].Value != null)
         {
             conta.Telefone4 = dataGridView1.SelectedRows[0].Cells["telefone4"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["telefone5"].Value != null)
         {
             conta.Telefone5 = dataGridView1.SelectedRows[0].Cells["telefone5"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["telefone6"].Value != null)
         {
             conta.Telefone6 = dataGridView1.SelectedRows[0].Cells["telefone6"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["email1"].Value != null)
         {
             conta.Email1 = dataGridView1.SelectedRows[0].Cells["email1"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["email2"].Value != null)
         {
             conta.Email2 = dataGridView1.SelectedRows[0].Cells["email2"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["email3"].Value != null)
         {
             conta.Email3 = dataGridView1.SelectedRows[0].Cells["email3"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["email4"].Value != null)
         {
             conta.Email4 = dataGridView1.SelectedRows[0].Cells["email4"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["olx_usuario"].Value != null)
         {
             conta.OlxUsuario = dataGridView1.SelectedRows[0].Cells["olx_usuario"].Value.ToString();
         }
         if (dataGridView1.SelectedRows[0].Cells["olx_senha"].Value != null)
         {
             conta.OlxSenha = dataGridView1.SelectedRows[0].Cells["olx_senha"].Value.ToString();
         }
         return(conta);
     }
     return(null);
 }