コード例 #1
0
        public static Respuesta ActualizarContactoCRM(Guid ContactoID, string Nombres, string Apellidos, string Puesto, Guid EmpresaID, int MetodoContacto)
        {
            Respuesta resp = new Respuesta();

            try
            {
                using (SimpleConnection365 cnn = new SimpleConnection365(Constantes.ConnectionStringName))
                {
                    using (ContactoServicio contactoSvc = new ContactoServicio(cnn.ObtenerServicioConexion()))
                    {
                        Contacto con = new Contacto();
                        con.ContactoID     = ContactoID;
                        con.Nombres        = Nombres;
                        con.Apellidos      = Apellidos;
                        con.Puesto         = Puesto;
                        con.Cuenta         = new CrmLookup(EmpresaID, null, "account");
                        con.MetodoContacto = new CrmPicklist(MetodoContacto);
                        con.LimpiarAtributos(new string[] { "jobtitle" });


                        resp = contactoSvc.Guardar(con);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(resp);
        }