Beispiel #1
0
 public void TestCreateAccount()
 {
     Account act = new Account();
     act.ID = Guid.NewGuid().ToString();
     act.Name = "Tester";
     Account r = AccountManager.CreateAccount(act, "123456");
     AccountManager.DeleteAccount(r.ID);
 }
Beispiel #2
0
 public void TestModifyAccount()
 {
     Account act = new Account();
     act.ID = Guid.NewGuid().ToString();
     act.Name = "Tester";
     Account r = AccountManager.CreateAccount(act, "123456");
     DateTime now = DateTime.Now;
     
     String user = Thread.CurrentPrincipal.Identity.Name;
     r.Email = "*****@*****.**";
     r.MobilePhone = "13012938823";
     AccountManager.UpdateAccount(r);
     Account r1 = AccountManager.QueryAccount(a => a.ID == r.ID).FirstOrDefault();
     Assert.IsNotNull(r1);
     Assert.IsTrue(r.Email == r1.Email);
     Assert.IsTrue(r.MobilePhone == r1.MobilePhone);
     Assert.IsTrue(r.ModifiedBy == user);
     Assert.IsTrue(r.ModifiedTime >= now);
     AccountManager.DeleteAccount(r.ID);
 }
Beispiel #3
0
 /// <summary>
 /// Update account 
 /// </summary>
 /// <param name="account">Account info</param>
 public static void UpdateAccount(Account account)
 {
     GetInstance().GetProvider().Update(account);
 }
Beispiel #4
0
 /// <summary>
 /// Create new user account
 /// </summary>
 /// <param name="info">Information of new account</param>
 /// <param name="password">Password of new account</param>
 /// <returns>Created account</returns>
 public static Account CreateAccount(Account info, String password)
 {
     return GetInstance().GetProvider().Create(info, password);
 }
Beispiel #5
0
 public abstract void Update(Account account);
Beispiel #6
0
 public abstract Account Create(Account info, string password);
Beispiel #7
0
 /// <summary>
 /// Update fields from another account
 /// </summary>
 /// <param name="account"></param>
 internal void UpdateFrom(Account account)
 {
     Name = account.Name;
     Email = account.Email;
     MobilePhone = account.MobilePhone;
 }