Пример #1
0
 public StudentServiceHanlder()
 {
     this.loginService = new LoginServiceHanlder();
     if (!this.loginService.Validate())
     {
         throw
             new FaultException(
                 new FaultReason("Please login first!"),
                 new FaultCode("Error:0x0001"));
     }
 }
Пример #2
0
        public override void Validate(string userName, string password)
        {
            RequestCredential rc = new RequestCredential()
            {
                UserName = userName,
                Password = password,
                Domain   = "mhs"
            };
            GeneralResponse <RequestCredential> loginResult = new LoginServiceHanlder().Login(rc);

            if (!loginResult.IsSuccess())
            {
                FaultException fault =
                    new FaultException(
                        new FaultReason("UserName or password is wrong!"),
                        new FaultCode("Error:0x0001"));
                throw fault;
            }
        }