using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AddArticles : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        using (DataBaseContext db = new DataBaseContext())
        {
            article obj = null;
            obj = new article();
            obj.Title = "مقالاه شماره یک";
            obj.Descriptions = "توضیحات";
            obj.IsActive = true;
            db.articles.Add(obj);
            obj = new article();
            obj.Title = "مقالاه شماره دو";
            obj.Descriptions = "توضیحات";
            obj.IsActive = true;
            db.articles.Add(obj);
            obj = new article();
            obj.Title = "مقالاه شماره سه";
            obj.Descriptions = "توضیحات";
            obj.IsActive = true;
            db.articles.Add(obj);
            db.SaveChanges();
            string Msg = "مقاله با موفقیت ثبت شد";
            ScriptManager.RegisterStartupScript(Page, typeof(Page),
            "Alert", "<script>alert('" + Msg + "');</script>",false);
        }
    }
}