Exemplo n.º 1
0
        /// <summary>
        /// Saves the relation address item.
        /// </summary>
        /// <param name="relationAddressItem">The relation address item.</param>
        /// <returns>Broobu.Contact.Contract.Domain.RelationAddressItem.</returns>
        public RelationXAddress SaveRelationAddressItem(RelationXAddress relationAddressItem)
        {
            System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
            if (Logger.IsDebugEnabled)
            {
                Logger.Debug("Method IContact.SaveRelationAddressItem 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.SaveRelationAddressItem ({0})", timer.Elapsed);
                }
                return(clt.SaveRelationAddressItem(relationAddressItem));
            }
            finally
            {
                if (Logger.IsDebugEnabled)
                {
                    Logger.DebugFormat("Closing client ({0})", timer.Elapsed);
                }
                CloseClient(clt);
                if (Logger.IsDebugEnabled)
                {
                    Logger.DebugFormat("Method IContact.SaveRelationAddressItem finished ({0})", timer.Elapsed);
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Saves the relation address item asynchronous.
 /// </summary>
 /// <param name="relationAddressItem">The relation address item.</param>
 /// <param name="action">The action.</param>
 public void SaveRelationAddressItemAsync(RelationXAddress relationAddressItem, Action <RelationXAddress> action = null)
 {
     using (System.ComponentModel.BackgroundWorker wrk = new System.ComponentModel.BackgroundWorker())
     {
         var res = (RelationXAddress)null;
         wrk.DoWork += (s, e) =>
         {
             res = SaveRelationAddressItem(relationAddressItem);
         };
         wrk.RunWorkerCompleted += (s, e) =>
         {
             if (action != null)
             {
                 action(res);
             }
             else if (SaveRelationAddressItemCompleted != null)
             {
                 SaveRelationAddressItemCompleted(res);
             }
             wrk.Dispose();
         };
         wrk.RunWorkerAsync();
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Saves the relation address item.
 /// </summary>
 /// <param name="relationAddressItem">The relation address item.</param>
 /// <returns>RelationXAddress.</returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public RelationXAddress SaveRelationAddressItem(RelationXAddress relationAddressItem)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Deletes the relation address item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <returns>Result.</returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public Result DeleteRelationAddressItem(RelationXAddress item)
 {
     throw new System.NotImplementedException();
 }