// Personal Webpage Engine
// Copyright(c) 2008 Mihail Kochanov
// You can contact me at StilgarAD@yahoo.com
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.

//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.

//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
//------------------------------------------------------------------------------
//
// Personal Web Page Engine
//
//------------------------------------------------------------------------------

using System;
using System.Configuration;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Admin
{
    public partial class AddNewsItem : System.Web.UI.Page
    {

        #region PageEvents

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        #endregion

        #region ControlEvents

        protected void nieEditor_Save(object sender, EventArgs e)
        {
            NewsItem post = nieEditor.NewsItem;

            using (BlogNETDataContext dc = new BlogNETDataContext())
            {
                dc.NewsItems.InsertOnSubmit(post);
                dc.SubmitChanges();
            }

            Cache.Remove(Constants.Cache.Tags);

            Response.Redirect("~/Main.aspx");
        }

        #endregion

    }
}