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

namespace CarGallery
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // ma ye Class dorost kardim be esme DatabaseRepository ke hame bala hayi ke
            // qarare sare database biarim ro toosh tarif kardim
            // miaym az oon class ye instance misazim ke betooniim azash estefade konim

            DatabaseRepository repo = new DatabaseRepository();

            // ye method to oon class dashtim be esme postGetSlide() ke ye dataTable barmigardoone ke in sotoon ha ro dare : title , post_id , img

            // ye repeater gozashte boodim goftam karesh ine ke ye chizio tekrar kone
            // miad ye daste etela at migire va be tedadesh ye seri chiza ro ba ye meqdare khas tekrar mikone
            // miam datasoure repeater ro mizarim datatable i ke etela at ro barmigardoone

            Repeater1.DataSource = repo.postGetSlide();
            Repeater1.DataBind();  // bad bayad dataBind ro seda bezanim ta etela at sabt beshe vase namayesh
        }
    }
}