/// <summary> /// Retorna a lista de emails disponÃveis de um determinado cliente /// </summary> /// <returns></returns> public List <string> GetEmails() { Conection.DeskOpen(); List <string> listemails = new List <string>(); command = new MySqlCommand("SELECT ema_cl1, www_cl1 from v11_mafra.cadastrosclientesfornecedoresrepresentadastransportadoras WHERE id__cl1 = " + id_vip, Conection.DeskConection); string add1, add2, aux2; string[] aux; using (MySqlDataReader read = command.ExecuteReader()) { while (read.Read()) { if (!String.IsNullOrEmpty(read["ema_cl1"].ToString()) || !String.IsNullOrEmpty(read["www_cl1"].ToString())) { add1 = read["ema_cl1"].ToString(); add2 = read["www_cl1"].ToString(); aux = add1.Split(';'); foreach (string str in aux) { aux2 = str.Replace(" ", string.Empty); listemails.Add(aux2); } aux = add2.Split(';'); foreach (string str in aux) { aux2 = str.Replace(" ", string.Empty); listemails.Add(str); } } else { break; } } } Conection.DeskConection.Close(); return(listemails); }