public static void DeleteTradingPartnerSpecCertWithMetadata(BizRuleCertMetadata bizRuleCertMetadata, IDalManager dalManager) { if (GCValidatorHelper.AddDummyDataForCertValidation) { return; } // TODO: Ideally we should keep audit trail of delete // Following function will remove the table entry altogether. dalManager.DeleteBizRuleCertMetadata(bizRuleCertMetadata); dalManager.DeleteBizRuleCert(bizRuleCertMetadata); SchemaCache.RemoveBizRuleCert(bizRuleCertMetadata.RuleCertFileName); }
// Should we always overwrite the existing one? public static void UploadBizRuleCert(string certFileName, Stream certFileStream, string userName, IDalManager dalManager) { if (GCValidatorHelper.AddDummyDataForCertValidation) { return; } BizRuleCertMetadata bizRuleCertMetadata = new BizRuleCertMetadata(); // Purposely ignoring Initialize function return type (errors) since I don't expect errors here. bizRuleCertMetadata.Initialize(certFileName, userName, DateTime.UtcNow); dalManager.SaveBizRuleCert(certFileStream, bizRuleCertMetadata); dalManager.SaveBizRuleCertMetadata(bizRuleCertMetadata); SchemaCache.RemoveBizRuleCert(bizRuleCertMetadata.RuleCertFileName); }