Example #1
0
    private void Test_User()
    {
        JASIT.DAL.ClearCache();
        Response.Write("---------------------------------------------<br />");
        Response.Write("<h3>Checking User class</h3><br />");

        JASIT.ORM.User TestUser = new JASIT.ORM.User();

        TestUser = JASIT.ORM.User.Register("Test.User", "Test.Password", "*****@*****.**");
        Response.Write("New user registered<br />");
        Response.Write(TestUser.UserID + " - " + TestUser.UserName);
        Response.Write("<br />");

        TestUser = JASIT.ORM.User.Login("Test.User", "Test.Password");
        Response.Write("New user login<br />");
        Response.Write(TestUser.UserID + " - " + TestUser.UserName);
        Response.Write("<br />");

        TestUser.UserName = "******";
        TestUser.Save();
        TestUser = new JASIT.ORM.User(TestUser.UserID);
        Response.Write("Change user name<br />");
        Response.Write(TestUser.UserID + " - " + TestUser.UserName);
        Response.Write("<br />");

        Response.Write("---------------------------------------------<br />");
    }
Example #2
0
 public static User Register(string userName, string password, string email)
 {
     User newUser = new User();
     newUser.UserName = userName;
     newUser.Password = password;
     newUser.Email = email;
     newUser.RegisteredTime = DateTime.Now;
     newUser.LastLogin = DateTime.Now;
     newUser.Save();
     return newUser;
 }