Ejemplo n.º 1
0
 private void OnRoomCommentsListRemove(RoomComments entity)
 {
     SendPropertyChanging(null);
     entity.Room = null;
     SendPropertyChanged(null);
 }
Ejemplo n.º 2
0
 private void OnRoomCommentsListAdd(RoomComments entity)
 {
     SendPropertyChanging(null);
     entity.Room = this;
     SendPropertyChanged(null);
 }
Ejemplo n.º 3
0
 private void OnRoomCommentsListAdd(RoomComments entity)
 {
     SendPropertyChanging(null);
     entity.User = this;
     SendPropertyChanged(null);
 }
Ejemplo n.º 4
0
 private void OnRoomCommentsListRemove(RoomComments entity)
 {
     SendPropertyChanging(null);
     entity.User = null;
     SendPropertyChanged(null);
 }
Ejemplo n.º 5
0
        /// <summary>
        ///     Handles the Click event of the btnPostComment control.
        /// </summary>
        /// <param name = "sender">The source of the event.</param>
        /// <param name = "e">The <see cref = "System.EventArgs" /> instance containing the event data.</param>
        protected void btnPostComment_Click(object sender, EventArgs e)
        {
            //Will insert comments about the site here.
            if (txtComments.Text != String.Empty)
            {
                if (_litComments.Text == "Your Comments")
                {
                    _litComments.Text = string.Empty;
                }
                _litComments.Text = _litComments.Text + "Rating: <strong>" + LastRating + "</strong> <p>" + txtComments.Text + "</p><br/>";

                //Create Comment Object
                var roomRating = new RoomComments
                                     {
                                         Comments = txtComments.Text,
                                         RoomID = RoomId,
                                         UserID = Cu.Id,
                                         Score = LastRating,
                                         DatePosted = DateTime.Now
                                     };
                var db = new UrbanDataContext();
                db.RoomComments.InsertOnSubmit(roomRating);
                db.SubmitChanges();
                //Redirect to same page with comment success
                RadAjaxManager.GetCurrent(Page).Redirect(String.Format("RoomDetails.aspx?roomId={0}&message={1}", RoomId, "Comment successfully submitted."));
            }

            //Close tooltip

            RadAjaxManager.GetCurrent(Page).ResponseScripts.Add("CloseToolTip1();");
        }