Como criar países no Eye Peak via WebService?
Este documento descreve os passos necessários para criar o seu primeiro País no Eye Peak via WebServices. A arquitetura do Eye Peak permite que sejam integrados dados de sistemas externos tais como ERPs, sendo que os tipos de dados que poderão ser integrados são: artigos, entidades, documentos, armazéns, unidades e famílias. A integração de sistemas externos é realizada através de Web Services, conforme já explicado no artigo “Como criar um projeto de integração com o Eye Peak via WebServices? ”. Criar uma chamada ao método “Add”. Criar uma chamada ao método “Change”. Veja um exemplo sobre a tecnologia de integração com o Eye Peak no GitHub.Pré-Requisitos
Passo 1 – Criar uma classe “Countries” para proceder ao tratamento dos métodos dos Operadores
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sync.WMS.WMSDataImportWS;
namespace Sync.WMS
{
public class Countries
{
private WMSDataImportClient m_WSClient;
public Countries()
{
m_WSClient = Utils.WS_CLIENT();
}
public void Add()
{
// Web Service of the Entity to be used
Sync.WMS.WMSDataImportWS.CountryRequest wsEntity = new CountryRequest();
//Required Fields
wsEntity.ERPCompany = "DEMOWMS510";
wsEntity.CountryCode = "PT";
wsEntity.Description = "Portugal";
wsEntity.ISOA2 = "PT";
wsEntity.ISOA3 = "PRT";
wsEntity.ISOAN = "620";
wsEntity.Community = "EU";
//Saving
object result;
result = m_WSClient.SaveCountry(wsEntity);
}
public void Change()
{
// Web Service of the Entity to be used
Sync.WMS.WMSDataImportWS.CountryRequest wsEntity = new CountryRequest();
//Required Fields
wsEntity.ERPCompany = "DEMOWMS510";
wsEntity.CountryCode = "PT";
wsEntity.Description = "Portugal PT";
wsEntity.ISOA2 = "PT";
wsEntity.ISOA3 = "PRT";
wsEntity.ISOAN = "620";
wsEntity.Community = "EU";
//Saving
object result;
result = m_WSClient.SaveCountry(wsEntity);
}
}
}
Passo 2 – Criar a chamada ao método de criação do País
private void btnAddCountry_Click(object sender, EventArgs e)
{
Sync.WMS.Countries Country = new Sync.WMS.Countries();
Country.Add();
}
Passo 3 – Criar a chamada ao método de alteração do País
private void btnChangeCountry_Click(object sender, EventArgs e)
{
Sync.WMS.Countries Country = new Sync.WMS.Countries();
Country.Change();
}
login para deixar a sua opinião.