示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     MysliCustomConnector connector = new MysliCustomConnector();
     connector.OpenConnection();
     repEvent.DataSource = connector.GetdDatasetOfEventsByCategory("teatteri");
     connector.CloseConnection();
     repEvent.DataMember = "Events";
     repEvent.DataBind();
 }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            admincontent.Visible = false;

            if (Request.Cookies["UserName"] != null)
            {
                username = Request.Cookies["UserName"].Value;
            }

            if (username == "admin")
            {
                admincontent.Visible = true;
            }

            MysliCustomConnector connector = new MysliCustomConnector();
            connector.OpenConnection();
            repEvent.DataSource = connector.GetAllEvents();
            connector.CloseConnection();
            repEvent.DataMember = "Events";
            repEvent.DataBind();
        }
示例#3
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            MysliCustomConnector connector = new MysliCustomConnector();
            connector.OpenConnection();
            txtB1.Text = "Yhteys avattu";
            if (connector.VerifyLogin(txtUser.Text, txtPasswd.Text))
            {
                txtB2.Text = "ONNISTUI";
                connector.CloseConnection();

                Response.Cookies["UserName"].Value = txtUser.Text;
                // Response.Cookies["userName"].Expires = DateTime.Now.AddDays(1); ÄLÄ ASETA, koska nyt se poistetaan käyttjän sulkiessa selain
                //Server.Transfer("default.aspx");
                Response.Redirect("~/default.aspx");
            }
            else
            {
                txtB2.Text = "FAILED";
                //Server.Transfer("loginfailed.aspx");
                connector.CloseConnection();
            }
        }