private void CarregaComentarios() { var comentarios = (List <BR_Comentario_Prato>)ComentarioPratoService.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_Prato(); Int32.TryParse(Page.RouteData.Values["idPrato"].ToString(), out Id); obj.Id_Usuario = ((BR_Usuario)UsuarioService.SelectIdByName(Context.User.Identity.Name).RetObj).Id; obj.Id_Prato = Id; obj.Comentario = txtComentar.Text; ComentarioPratoService.Insert(obj); txtComentar.Text = ""; CarregaComentarios(); } }