protected void Button1_Click(object sender, EventArgs e)
    {
        if (txt_titr.Text == "")
        {
        }
        else
        {
            if (FileUpload1.HasFile)
            {
                string str = FileUpload1.FileName;
                FileUpload1.PostedFile.SaveAs(Server.MapPath("~/img1_news/" + str));
                string Image = FileUpload1.PostedFile.FileName;
                string titr  = txt_titr.Text;
                string matn  = txt_matn.Text;

                string str2 = matn.Substring(0, 100);



                using (DataSetTableAdapters.newsTableAdapter insert1 = new DataSetTableAdapters.newsTableAdapter())
                {
                    insert1.Insert(titr, matn, Image, 0, str2);
                    txt_titr.Text = "";
                    txt_matn.Text = "";
                    Response.Redirect("~/Admin/news.aspx");
                }
            }
        }
    }
 protected void Button2_Click(object sender, EventArgs e)
 {
     using (DataSetTableAdapters.newsTableAdapter del1 = new DataSetTableAdapters.newsTableAdapter())
     {
         del1.Delete(Convert.ToInt32(TextBox1.Text));
         Response.Redirect("~/Admin/news.aspx");
     }
 }
 protected void Button3_Click(object sender, EventArgs e)
 {
     if (TextBox2.Text != "")
     {
         using (DataSetTableAdapters.newsTableAdapter del1 = new DataSetTableAdapters.newsTableAdapter())
         {
             del1.Update_newstutuse(Convert.ToInt32(TextBox2.Text));
             Response.Redirect("~/Admin/news.aspx");
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["grp"] != "")
        {
            string groups = Request.QueryString["grp"];

            int id_news;
            id_news = Convert.ToInt32(groups);

            string s1;
            s1 = "";
            string s2;
            s2 = "";
            string s3;
            s3 = "";
            int i;
            i = 0;



            //***************axe bala

            using (DataSetTableAdapters.newsTableAdapter ins1 = new DataSetTableAdapters.newsTableAdapter())
            {
                DataSet.newsDataTable ne1 = ins1.selectnew22(id_news);
                foreach (DataSet.newsRow row3 in ne1)
                {
                    s1 += "<h3 class='center1' runat='server'>" + row3.titr_news + "</h3>";
                    s1 += "<img class='center' src='img1_news/" + row3.pic_news + "' alt='آموزشگاه موسیقی سرایش' class='img-responsive' style='height: 500px; width:600px' >";
                    s1 += "<div class='blog-desc'>";
                    s1 += "<p class='farsi-font farsi-dir'>" + row3.matn_news + "<div class='blog-desc'></p>";



                    s1 += "</div>";



                    s3 += "<p class='farsi-font farsi-dir'>" + row3.Desc_news + "</p>";
                    s3 += "</div>";
                }


                ///end jadval classs
            }
            Literal1.Text = s1;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string s1;

        s1 = "";
        string s2;

        s2 = "";
        string s3;

        s3 = "";
        int i;

        i = 0;



//اسلایدر بالای صفحه


        using (DataSetTableAdapters.Select_slide1TableAdapter ins = new DataSetTableAdapters.Select_slide1TableAdapter())
        {
            DataSet.Select_slide1DataTable ne = ins.Select_slider1();
            foreach (DataSet.Select_slide1Row row1 in ne)
            {
                i += 1;

                s1 += "<li><img src = 'img1_show/" + row1.pic + "' alt='موسیقی سرایش' title ='1' id ='wows1_0'/></li>";
            }
        }
        Literal1.Text = s1;


        //انتهای اسلایدر


        //********اطلاعیه وسط صفحه
        using (DataSetTableAdapters.newsTableAdapter ins1 = new DataSetTableAdapters.newsTableAdapter())
        {
            DataSet.newsDataTable ne1 = ins1.select_news1();
            foreach (DataSet.newsRow row2 in ne1)
            {
                i += 1;

                //  s1 += "<li><img src = 'img1_show/" + row1.pic + "' alt='موسیقی سرایش' title ='1' id ='wows1_0'/></li>";
                s2 += "<p class='farsi-dir farsi-align farsi-font lead'>" + row2.titr_news + "</p>'";
                //   s2 += "<a href = 'newsnow?id="+row1.id_news+"' class='farsi-font btn btn-primary'>لینک</a>";
            }
        }
        Literal2.Text = s2;

        //اخبار پایین صفحه

        using (DataSetTableAdapters.newsTableAdapter ins3 = new DataSetTableAdapters.newsTableAdapter())
        {
            DataSet.newsDataTable ne3 = ins3.select_new3();
            foreach (DataSet.newsRow row3 in ne3)
            {
                i += 1;


                s3 += "<div class='col-lg-4 col-md-12'>";
                s3 += "<div class='blog-box'>";
                s3 += " <div class=''>";
                s3 += "<img src ='img1_news/" + row3.pic_news + "' alt='آموزشگاه سرایش'class='img-responsive' style=''>";
                s3 += "<div class='magnifier'>";
                s3 += "<a href = 'blog-single.html' title=''><i class='flaticon-add'></i></a>";
                s3 += "</div>";
                s3 += "</div>";
                s3 += "<div class='blog-desc'>";
                s3 += "<h4 class='farsi-font farsi-dir'><a href = 'Newsone.aspx?grp=" + row3.id_news + "'>" + row3.titr_news + " </a></h4>";



                s3 += "<p class='farsi-font farsi-dir'>" + row3.Desc_news + "</p>";
                s3 += "</div>";
                s3 += "</div>";
                s3 += "</div>";
            }
        }
        Literal3.Text = s3;
    }