Esempio n. 1
0
 protected void BRegisterUser_Click(object sender, EventArgs e)
 {
     string email = TBEmail.Text,
         password = TBPassword.Text,
         name = TBName.Text;
     DBHelper db = new DBHelper(AgentUtileries.dbcstring);
     db.RegisterUser(email, password, name);
     int id = db.Authenticate(email, password);
     if (id > 0)
     {
         AUser user = db.GetUser(id);
         Session["user"] = user;
         Response.Redirect("~/Default.aspx");
     }
     else
     {
         Response.Redirect("~/User/Login.aspx");
     }
 }
Esempio n. 2
0
        public XElement RegisterUser(string email, string password, string name)
        {
            XElement x = new XElement("users");

            DBHelper db = new DBHelper(AgentUtileries.dbcstring);
            db.RegisterUser(email, password, name);

            return x;
        }