コード例 #1
0
        public MCustH GetCustomer(string custCode)
        {
            var repo     = _readOnlyRepositoryFactory.GetDataRepository <IMCustHRepository>();
            var entities = repo.GetByExample(new MCustHParams
            {
                CompCode = "H2",
                CustCode = custCode
            });

            return(entities.FirstOrDefault());
        }
コード例 #2
0
        public void Authenticate(string opcode, string password)
        {
            var repo = _readOnlyRepositoryFactory.GetDataRepository <IMOpRepository>();

            var user = repo.Get(opcode.ToUpper());

            if (user == null)
            {
                throw new ArgumentException("Invalid user");
            }

            if (CiscoSnCycEngine.IsAdminUser(opcode))
            {
                var setting = ConfigurationManager.AppSettings["adminPassword"];
                if (password != setting)
                {
                    throw new ArgumentException("Invalid Password");
                }
            }
        }