示例#1
0
        public ManagedSaveResult ManagedSave()
        {
            Blackbaud.PIA.RE7.BBREAPI.bbCantSaveReasons deniedReason = Blackbaud.PIA.RE7.BBREAPI.bbCantSaveReasons.csrObjectInReadOnlyMode;
            string deniedMsg = string.Empty;

            bool canSave  = this.CanBeSaved(ref deniedReason, ref deniedMsg);
            bool wasSaved = false;

            if (canSave)
            {
                try
                {
                    this.Save();
                    wasSaved = true;
                }
                catch (System.Runtime.InteropServices.COMException badSave)
                {
                    deniedMsg = badSave.Message + "\nStack Trace: " + badSave.StackTrace;
                    wasSaved  = false;
                }
            }

            return(new ManagedSaveResult(wasSaved, deniedReason, deniedMsg));
        }
示例#2
0
 internal ManagedSaveResult(bool wasSaved, Blackbaud.PIA.RE7.BBREAPI.bbCantSaveReasons result, string message)
 {
     WasSaved = wasSaved;
     Result   = wasSaved ? SaveResult.Saved : (SaveResult)result;
     Message  = message;
 }