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); } }
public static bool IsAccountRegistered(string name) { return(UnityContainerRepository.getInstance().container.Resolve <IAccountDAL>().IsAccountRegistered(name)); }
public static int ValidateAccount(string name, string passWord) { return(UnityContainerRepository.getInstance().container.Resolve <IAccountDAL>().ValidateAccount(name, passWord)); }