1
Example:
I want to take the amount that was typed into this TextBox
and as soon as I trigger the button event bthResposta
I can recover the same to be able to set the class properties./
Obs. To access this field, I click on a grid button that opens a popup
<asp:TextBox ID="txtComentario" runat="server" MaxLength="40" Width="800px" MinLenght="15" Rows="5" TextMode="MultiLine"></asp:TextBox>
Event
protected void BtnResposta_Click(object sender, EventArgs e)
{
try
{
if (objWebItens.OcIOcorrencia > 0)
{
WebOcorrItens objItens = new WebOcorrItens();
objItens.OcIOcorrencia = objWebItens.OcIOcorrencia;
objItens.OcIAcao = "C";
objItens.OcIDescr = // valor digitado no TextBox
objItens.OcIDtCad = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
objItens.OcIIdInc = (string)Session["login"];
objItens.OcIDtInc = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
objItens.OcIArea = objWebItens.OcIArea;
objItens.InserirDados();
if(objWebItens.ConsultarOcorrenciaItens(Convert.ToString(objWebItens.OcIOcorrencia)) > 0)
{
WebOcorrencias webOcorrencias = new WebOcorrencias();
if (webOcorrencias.ConsultarOcorrencia(objItens.OcIOcorrencia.ToString()) > 0)
{
webOcorrencias.OcIdAlt = (string)Session["login"];
webOcorrencias.OcDtAlt = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
//webOcorrencias.AlterarOcorrencia();
}
EnviarEmailChamado(objItens, "Resposta do Chamanto Nº " + objItens.OcIOcorrencia + "");
}
}
}
catch (Exception ex)
{
throw ex;
}
}