Exemplo n.º 1
0
 public new int Insert(User_Info obj)
 {
     if (obj == null)
     {
         SetError(98, "Object is null");
         return(Error_Number);
     }
     if (string.IsNullOrEmpty(obj.Branch_ID))
     {
         SetError(98, "Branch is null or empty");
         return(Error_Number);
     }
     if (string.IsNullOrEmpty(obj.FullName))
     {
         SetError(98, "FullName is null or empty");
         return(Error_Number);
     }
     if (string.IsNullOrEmpty(obj.Password))
     {
         SetError(98, "Password is null or empty");
         return(Error_Number);
     }
     obj.Password = myCrypt.Encrypt(obj.Password);
     if (base.Insert(obj) != 0)
     {
         SetError(0, String.Empty);
     }
     else
     {
         SetError(99, dalUser.GetException.Message);
     }
     return(Error_Number);
 }
Exemplo n.º 2
0
        public string Authenticate(string userName, string password)
        {
            var account = AccountRepository.Get(userName);

            if (account != null)
            {
                if (account.ValidatePassword(CryptProvider, password))
                {
                    return(CryptProvider.Encrypt(account.CreateToken().GenerateString(DateProvider)));
                }
            }
            return(string.Empty);
        }
Exemplo n.º 3
0
        public string response_string(string key)
        {
            CryptProvider myen = new CryptProvider();

            return(myen.Encrypt(key, response_string()));
        }
Exemplo n.º 4
0
 public string Request(string xmlstr)
 {
     return(myen.Decrypt(myac.Request(myen.Encrypt(xmlstr))));
 }