Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["adminid"] != null)
     {
         if (!IsPostBack)
         {
             SliderRepository repSlider = new SliderRepository();
             gvSlider.DataSource = repSlider.LoadSliders();
             gvSlider.DataBind();
             ContactUsRepository repContact = new ContactUsRepository();
             ContactWay          cnw        = repContact.Findcwy(1);
             tbxAbout.Text     = cnw.AboutUs;
             tbxAdress.Text    = cnw.Adrees;
             tbxMail.Text      = cnw.Email;
             tbxPhone.Text     = cnw.PhoneNumber;
             tbxAboutPage.Text = cnw.AboutPage;
             tbxInsta.Text     = cnw.Instagram;
             tbxtele.Text      = cnw.Telegram;
             AdminsRepository ad    = new AdminsRepository();
             DataAccess.Admin admin = ad.getAdmin(Session["adminid"].ToString().ToInt());
             tbxPass.Text = admin.Password;
         }
     }
     else
     {
         Response.Redirect("/AdminLogin");
     }
 }
Exemplo n.º 2
0
        protected void gvSlider_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            gvSlider.PageIndex = e.NewPageIndex;
            SliderRepository repSlider = new SliderRepository();

            gvSlider.DataSource = repSlider.LoadSliders();
            gvSlider.DataBind();
        }