/// <summary> /// Retrieving Contact from CRM /// </summary> /// <param name="contactId"> the Contact id. </param> /// <returns> VTigerContact entity </returns> public VTigerContact ReadContact(string contactId) { VTigerContact contact = new VTigerContact(); try { contact = this.vTigerService.Retrieve<VTigerContact>(contactId); } catch (Exception ex) { this.LoggerService.LogException("Retrieving Contact :- " + ex.Message); } return contact; }
/// <summary> /// Adding Contact into CRM /// </summary> /// <param name="contact"> the Contact entity. </param> /// <returns> VTigerContact entity </returns> public VTigerContact CreateContact(VTigerContact contact) { try { contact = this.vTigerService.Create<VTigerContact>(contact); } catch (Exception ex) { this.LoggerService.LogException("Adding Contact :- " + ex.Message); contact = new VTigerContact(); } return contact; }
/// <summary> /// Updating Contact in CRM /// </summary> /// <param name="contact">the Contact entity. </param> /// <returns> VTigerContact entity </returns> public VTigerContact UpdateContact(VTigerContact contact) { try { contact = this.vTigerService.Update<VTigerContact>(contact); } catch (Exception ex) { this.LoggerService.LogException("Updating Contact :- " + ex.Message); return null; } return contact; }