Esempio n. 1
0
        OrderEN O     = new OrderEN();                       //order entity

        protected void Page_Load(object sender, EventArgs e) //when page loads
        {
            if (!Page.IsPostBack)
            {
                d = cr.showAllCruises(); //list of the cruises
                GridView1.DataSource = d;
                GridView1.DataBind();
                ButtonLogin.Visible = false; //change buttons visibility
                ButtonBuy.Visible   = false;
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["login"] != null) //not user logged = redirect to login page
            {
                d = A.searchAdmin(Session["login"].ToString());
                int encontrado = Convert.ToInt32(d.Tables[0].Rows[0][0]); //if there is a admin , we return 1

                if (encontrado == 1)                                      //admin has access, client will be redirect to the default page
                {
                    d = c.showAllCruises();
                    GridView1.DataSource = d;
                    GridView1.DataBind();
                    EditButton.Visible = false;
                }
                else
                {
                    Response.Redirect("../Default.aspx");
                }
            }
            else
            {
                Response.Redirect("../Login.aspx");
            }
        }