private cliente Objetoadm_modulo() { cliente retorno = new cliente() { //ID = Convert.ToInt32(iDTextBox.Text), NOME = nOMETextBox.Text.Trim(), OBS = oBSTextBox.Text.Trim(), DATA = DateTime.Now.Date, DIAVENCIMENTO = dIAVENCIMENTOTextBox.Text.Trim(), EMAILPARTICULAR = eMAILPARTICULARTextBox.Text.Trim(), CPFCNPJ = cPFCNPJTextBox.Text.Trim(), TELEFONE1 = tELEFONE1TextBox.Text.Trim().Replace("(", "").Replace(")", "").Replace("-", "").Replace(" ", ""), TELEFONE2 = tELEFONE2TextBox.Text.Trim().Replace("(", "").Replace(")", "").Replace("-", "").Replace(" ", ""), ENDERECO = eNDERECOTextBox.Text.Trim(), BAIRRO = bAIRROTextBox.Text.Trim(), CIDADE = cIDADETextBox.Text.Trim(), CEP = cEPTextBox.Text.Trim(), NUMEROINDETIDADE = nUMEROINDETIDADETextBox.Text.Trim() }; if (this.foto == "Foto Original") { var mt = new CLIENTEDAL().CONSULTATODOSPELOID(Convert.ToInt32(iDTextBox.Text)); retorno.FOTO = mt.FOTO; } else { if (!string.IsNullOrEmpty(foto)) { retorno.CarregaImagem(this.foto); } } if (this.foto1 == "Foto Original") { var mt = new CLIENTEDAL().CONSULTATODOSPELOID(Convert.ToInt32(iDTextBox.Text)); retorno.IMAGEM1 = mt.IMAGEM1; } else { if (!string.IsNullOrEmpty(foto1)) { retorno.CarregaImagem1(this.foto1); } } if (this.foto2 == "Foto Original") { var mt = new CLIENTEDAL().CONSULTATODOSPELOID(Convert.ToInt32(iDTextBox.Text)); retorno.IMAGEM2 = mt.IMAGEM2; } else { if (!string.IsNullOrEmpty(foto2)) { retorno.CarregaImagem2(this.foto2); } } if (this.foto3 == "Foto Original") { var mt = new CLIENTEDAL().CONSULTATODOSPELOID(Convert.ToInt32(iDTextBox.Text)); retorno.IMAGEM3 = mt.IMAGEM3; } else { if (!string.IsNullOrEmpty(foto3)) { retorno.CarregaImagem3(this.foto3); } } if (string.IsNullOrWhiteSpace(iDTextBox.Text)) { retorno.ID = 0; } else { retorno.ID = Convert.ToInt32(iDTextBox.Text.Trim()); } return(retorno); }