Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int jugadorId = ((Jugador)Session["Logueado"]).JugadorId;
         var mensajes  = LogicaMensaje.FindByJugadores(jugadorId, 5);
         RptMensajes.DataSource = mensajes;
         RptMensajes.DataBind();
     }
 }
Пример #2
0
 protected void BtnEnviar_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(TxtMensaje.Text))
     {
         int     jugadorUno = ((Jugador)Session["Logueado"]).JugadorId;
         int     jugadorDos = int.Parse(HdnDestinatarioId.Value);
         Mensaje M          = new Mensaje
         {
             Fecha = DateTime.Now,
             Leido = false,
             Texto = TxtMensaje.Text
         };
         LogicaMensaje.Add(M, jugadorUno, jugadorDos);
     }
 }