Exemple #1
0
        /// <summary>
        /// Saves the relation document item.
        /// </summary>
        /// <param name="relationDocumentItem">The relation document item.</param>
        /// <returns>Broobu.Contact.Contract.Domain.RelationDocumentItem.</returns>
        public RelationXDocumentI SaveRelationDocumentItem(RelationXDocumentI relationDocumentItem)
        {
            System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
            if (Logger.IsDebugEnabled)
            {
                Logger.Debug("Method IContact.SaveRelationDocumentItem started");
                timer.Start();
            }
            IContact clt = null;

            try
            {
                if (Logger.IsDebugEnabled)
                {
                    Logger.DebugFormat("Creating client ({0})", timer.Elapsed);
                }
                clt = CreateClient();
                if (Logger.IsDebugEnabled)
                {
                    Logger.DebugFormat("Calling client.SaveRelationDocumentItem ({0})", timer.Elapsed);
                }
                return(clt.SaveRelationDocumentItem(relationDocumentItem));
            }
            finally
            {
                if (Logger.IsDebugEnabled)
                {
                    Logger.DebugFormat("Closing client ({0})", timer.Elapsed);
                }
                CloseClient(clt);
                if (Logger.IsDebugEnabled)
                {
                    Logger.DebugFormat("Method IContact.SaveRelationDocumentItem finished ({0})", timer.Elapsed);
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Saves the relation document item asynchronous.
 /// </summary>
 /// <param name="relationDocumentItem">The relation document item.</param>
 /// <param name="action">The action.</param>
 public void SaveRelationDocumentItemAsync(RelationXDocumentI relationDocumentItem, Action <RelationXDocumentI> action = null)
 {
     using (System.ComponentModel.BackgroundWorker wrk = new System.ComponentModel.BackgroundWorker())
     {
         var res = (RelationXDocumentI)null;
         wrk.DoWork += (s, e) =>
         {
             res = SaveRelationDocumentItem(relationDocumentItem);
         };
         wrk.RunWorkerCompleted += (s, e) =>
         {
             if (action != null)
             {
                 action(res);
             }
             else if (SaveRelationDocumentItemCompleted != null)
             {
                 SaveRelationDocumentItemCompleted(res);
             }
             wrk.Dispose();
         };
         wrk.RunWorkerAsync();
     }
 }
 /// <summary>
 /// Saves the relation document item.
 /// </summary>
 /// <param name="relationDocumentItem">The relation document item.</param>
 /// <returns>RelationXDocumentI.</returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public RelationXDocumentI SaveRelationDocumentItem(RelationXDocumentI relationDocumentItem)
 {
     throw new NotImplementedException();
 }
Exemple #4
0
 /// <summary>
 /// Deletes the relation document item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <returns>RelationDocumentItem.</returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public RelationXDocumentI DeleteRelationDocumentItem(RelationXDocumentI item)
 {
     throw new System.NotImplementedException();
 }