예제 #1
0
 public static int Add(string name, string passWord)
 {
     if (!IsAccountRegistered(name))
     {
         var account = new Data.Account()
         {
             Name        = name,
             Password    = passWord,
             IsDelete    = false,
             CreatedTime = DateTime.Now
         };
         var iocRepository = UnityContainerRepository.getInstance();
         var accountDAL    = iocRepository.container.Resolve <IAccountDAL>();
         return(accountDAL.Add(account));
     }
     else
     {
         return(-1);
     }
 }
예제 #2
0
 public static bool IsAccountRegistered(string name)
 {
     return(UnityContainerRepository.getInstance().container.Resolve <IAccountDAL>().IsAccountRegistered(name));
 }
예제 #3
0
 public static int ValidateAccount(string name, string passWord)
 {
     return(UnityContainerRepository.getInstance().container.Resolve <IAccountDAL>().ValidateAccount(name, passWord));
 }