Exemple #1
0
    public static void UnsubscribeAll(int patientID, string DB)
    {
        SystemVariables sysVariables = SystemVariableDB.GetAll(DB);

        if (sysVariables["AddressType"].Value == "Contact")
        {
            Contact[] emails = ContactDB.GetByEntityID(-1, patientID, 27, false, DB);
            foreach (Contact email in emails)
            {
                ContactDB.UpdateIsBillingIsNonbilling(email.ContactID, email.IsBilling, false, DB);
            }
        }
        else if (sysVariables["AddressType"].Value == "ContactAus")
        {
            ContactAus[] emails = ContactAusDB.GetByEntityID(-1, patientID, 27, false, DB);
            foreach (ContactAus email in emails)
            {
                ContactAusDB.UpdateIsBillingIsNonbilling(email.ContactID, email.IsBilling, false, DB);
            }
        }
        else
        {
            throw new Exception("Unknown AddressType in config: " + sysVariables["AddressType"].Value);
        }
    }