Esempio n. 1
0
        public ActionResult Save(int?id, Commenting comments, string title)
        {
            var blog = new blog();

            if (id.HasValue)
            {
                blog = MASTERdomain.blogs.SingleOrDefault(x => x.id == id.Value);
                if (blog == null)
                {
                    return(RedirectToAction("NotFound", "Error", new { area = "" }));
                }
            }
            else
            {
                // TODO: allow blog handle to be editable
                var    perma  = title.ToPerma();
                string perma1 = perma;
                if (db.blogs.Count(x => x.permalink == perma1 &&
                                   x.subdomainid == subdomainid.Value) != 0)
                {
                    perma = string.Format("{0}-{1}", db.blogs.Max(x => x.id) + 1, perma);
                }
                blog.permalink   = perma.ToMaxLength(100);
                blog.subdomainid = subdomainid.Value;
                MASTERdomain.blogs.Add(blog);
            }

            blog.comments = (short)comments;
            blog.title    = title;
            blog.updated  = DateTime.UtcNow;

            repository.Save();

            return(Json("Blog save successfully".ToJsonOKMessage()));
        }
        private void btnSubmitReview_Click(object sender, EventArgs e)
        {
            MessageBox.Show
                (" Your comment has been successfully Updated.\r ", "Update Successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
            string     comment    = txtBoxReview.Text;
            Commenting commenting = new Commenting(reviewId, comment);

            commenting.SaveComment();
            Initialisation();
        }
Esempio n. 3
0
    protected override void AddedControl(Control control, int index)
    {
        base.AddedControl(control, index);

        Commenting commentingControl = control as Commenting;

        if (commentingControl == null)
        {
            return;
        }
        commentingControl.OnComment_SendEmail += new Commenting_OnSendMail(Blog_Comment_OnSendEmail);
    }
Esempio n. 4
0
      public (IComment b, IAlbum c) ChooseToActionsOnAlbum(IUser a, string content, string action)
      {
          Func <IUser, string, (IComment, IAlbum)> commentingAlbum = (a, content) => Commenting.PostCommentOnAlbum(a, content);

          if (action == "commentingAlbum")
          {
              return(commentingAlbum(a, content));
          }
          if (string.IsNullOrEmpty(action))
          {
              return(commentingAlbum(a = null, content = null));
          }
          return(commentingAlbum(a = null, content = null));
      }