コード例 #1
0
 private static void InitTables()
 {
     if (!Users.HasAny())
     {
         var user = new User()
         {
             PasswordHash = MD5Hash.Get("123456", Encoding.Default),
             Login        = "******",
         };
         Users.AddNew(user);
     }
 }
コード例 #2
0
 protected void uiButtonRegister_Click(object sender, EventArgs e)
 {
     Users user = new Users();
     user.AddNew();
     user.FirstName = uiTextBoxFN.Text;
     user.LastName = uiTextBoxLN.Text;
     user.UserName = uiTextBoxUsername.Text;
     user.Password = uiTextBoxPassword.Text;
     user.Mail = uiTextBoxMail.Text;
     user.Address = uiTextBoxAddress.Text;
     user.City = uiTextBoxCity.Text;
     user.Country = uiTextBoxCountry.Text;
     user.Phone = uiTextBoxPhone.Text;
     user.Fax = uiTextBoxFax.Text;
     user.PostalCode = uiTextBoxPC.Text;
     user.State = uiTextBoxState.Text;
     user.Save();
     Session["UserLoggedIn"] = user;
     if (null != registered)
         registered(this, EventArgs.Empty);
 }