public Response AddRowsByDataExtensionName(DataExtensionRowHead dataExtensionRowHead)
        {
            var jsonResponse = new Response { Success = false };
            DataExtensionHelper deHelper = new DataExtensionHelper();

            try
            {
                jsonResponse = deHelper.AddRowsByDataExtensionName(dataExtensionRowHead);
            }
            catch (Exception ex)
            {
                LogError(ex);
            }

            return jsonResponse;
        }
Exemplo n.º 2
0
        public Response UpdateRowsByExtensionName(DataExtensionRowHead dataExtensionRowHead)
        {
            var response = new Response { Success = true, Warning = false };
            try
            {
                var deRowPost = new ET_DataExtensionRow
                {
                    AuthStub = conexion.ETCliente,
                    DataExtensionName = dataExtensionRowHead.DataExtensionName,
                };

                foreach (var dataExtensionRow in dataExtensionRowHead.DataExtensionRowList)
                {
                    deRowPost.ColumnValues.Add(dataExtensionRow.Nombre, dataExtensionRow.Valor);
                }

                try
                {
                    var postResponse = deRowPost.Patch();
                    response.Success = postResponse.Status;
                    response.Message = postResponse.Message;
                    response.Code = postResponse.Code;
                    response.Data = postResponse.Results;
                }
                catch (Exception exCreate)
                {
                    response.Success = false;
                    response.Message = exCreate.Message;
                }
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }

            return response;
        }
        public Response UpdateRowsByCustomerKey(DataExtensionRowHead dataExtensionRowHead)
        {
            var jsonResponse = new Response { Success = false };
            DataExtensionHelper deHelper = new DataExtensionHelper();

            try
            {
                jsonResponse = deHelper.UpdateRowsByCustomerKey(dataExtensionRowHead);
            }
            catch (Exception ex)
            {
                LogError(ex);
            }

            return jsonResponse;
        }