Exemplo n.º 1
0
 public bool Refresh(string stoNum, PawnSecVO pSecData, bool onlyDbData = false)
 {
     if (pSecData == null)
     {
         return(false);
     }
     if (!onlyDbData && string.IsNullOrEmpty(stoNum))
     {
         return(false);
     }
     this.pwnSecData = pSecData;
     if (!onlyDbData)
     {
         this.storeNumber = stoNum;
     }
     if (!onlyDbData && !this.populateClientData())
     {
         return(false);
     }
     if (!this.populateDbData(onlyDbData))
     {
         return(false);
     }
     if (!onlyDbData && !this.populateEsbData())
     {
         return(false);
     }
     this.Initialized = true;
     return(true);
 }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="pKey"></param>
 /// <param name="pubKey"></param>
 /// <param name="stoNum"></param>
 /// <param name="pSecData"></param>
 /// <param name="pApp"> </param>
 /// <param name="onlyDbData"> </param>
 public EncryptedConfigContainer(
     string pKey,
     string pubKey,
     string stoNum,
     PawnSecVO pSecData,
     PawnSecApplication pApp = PawnSecApplication.None,
     bool onlyDbData         = false)
 {
     this.Initialized = false;
     this.Created     = false;
     if (string.IsNullOrEmpty(pKey) || string.IsNullOrEmpty(pubKey))
     {
         return;
     }
     this._privateKey = pKey;
     this._publicKey  = pubKey;
     if (!this.formulateDecryptionKey())
     {
         throw new ApplicationException("Cannot create decryption key");
     }
     this.Created     = true;
     this.Initialized = this.Refresh(stoNum, pSecData, onlyDbData);
     if (this.Initialized)
     {
         this.AppType = pApp;
     }
 }