Example #1
0
    protected void CreateBlogEntry(object sender, EventArgs e)
    {
        lblError.Text = string.Empty;
        try
        {

            BlogManager bmo = new BlogManager();
            if (txtContent.Content != string.Empty && txtInsertTextbox.Text != string.Empty)
            {
                if (bmo.AddBlogEntry(txtInsertTextbox.Text, User.Identity.Name, txtContent.Content, getCat()))
                {
                    PrintBlog();
                    lbleditorMessage.Text = "Added one row to database";
                }
            }
            else {
                throw new Exception("You did not type anything into the textbox or the editor. Sorry at this moment we can not add your blog post.");

            }

        }
        catch (Exception ex)
        {
            handleError(ex.Message, ex);
        }
    }
 protected void CreateBlogEntry(object sender, EventArgs e)
 {
     lblError.Text = string.Empty;
     try
     {
         BlogManager bmo = new BlogManager();
         if (txtContent.Content != string.Empty && txtInsertTextbox.Text != string.Empty)
         {
             if (bmo.AddBlogEntry(txtInsertTextbox.Text, User.Identity.Name, txtContent.Content, getCat()))
             {
                 PrintBlog();
                 lbleditorMessage.Text = "Added one row to database";
             }
         }
         else
         {
             throw new Exception("You did not type anything into the textbox or the editor. Sorry at this moment we can not add your blog post.");
         }
     }
     catch (Exception ex)
     {
         handleError(ex.Message, ex);
     }
 }