Exemplo n.º 1
0
        protected void btnUCreate_Click(object sender, EventArgs e)
        {
            string Name  = tbUName.Text;
            string Pass  = tbUPass.Text;
            string Login = tbULogin.Text;
            string Email = tbUEmail.Text;
            int    Flag  = 0;//Convert.ToInt32(tbUFlag.Text);
            //int Id = 0;
            usr U = new usr();

            U.uName     = tbUName.Text;
            U.uPassword = tbUPass.Text;
            U.uLogin    = tbULogin.Text;
            U.uEmail    = tbUEmail.Text;
            U.uFlag     = Flag;
            U.SaveNew();
        }
Exemplo n.º 2
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string    login = tblogin.Text;
            string    pass  = tbPass.Value;
            string    sql   = "SELECT * FROM Users WHERE u_Login = '******' AND u_Password = '******'";
            Hashtable HT    = DBFc.getDataHashtable(sql, Glob.cnn);

            if (HT != null)
            {
                usr U = new usr();
                U.uLogin        = HT["u_Login"].ToString();
                U.uEmail        = HT["u_Email"].ToString();
                U.id            = Convert.ToInt32(HT["u_ID"]);
                Session["usr"]  = U;
                lblMessage.Text = "Logged in";
                huName.Value    = HT["u_Name"].ToString();
            }
            else
            {
                lblMessage.Text = "Wrong login or password.";
            }
        }