private void CarregaComentarios() { var comentarios = (List <BR_Comentario_Estabelecimento>)ComentariosEstabelecimentosService.SelectById(Id).RetObj; rptComentario.DataSource = comentarios; rptComentario.DataBind(); }
protected void btnComentar_OnClick(object sender, EventArgs e) { if (txtComentar.Text != String.Empty) { var obj = new BR_Comentario_Estabelecimento(); Int32.TryParse(Page.RouteData.Values["idEstabelecimento"].ToString(), out Id); obj.Id_Usuario = ((BR_Usuario)UsuarioService.SelectIdByName(Context.User.Identity.Name).RetObj).Id; obj.Id_Estabelecimento = Id; obj.Comentario = txtComentar.Text; ComentariosEstabelecimentosService.Insert(obj); txtComentar.Text = ""; CarregaComentarios(); } }