private void button2AbririMotor_Click(object sender, EventArgs e) { try { BSO = new ErpBS100.ErpBS(); StdBE100.StdBETipos.EnumTipoPlataforma tipoPlataforma = StdBE100.StdBETipos.EnumTipoPlataforma.tpEmpresarial; BSO.AbreEmpresaTrabalho(tipoPlataforma, "DEMO", "primavera", "qualquer"); //use this service to trigger the API events. ExtensibilityService service = new ExtensibilityService(); service.Initialize(BSO); // Check if service is operational if (service.IsOperational) { // Inshore that all extensions are loaded. service.LoadExtensions(); } label2EstadoMotor.Text = "Motor aberto..."; } catch (Exception) { label2EstadoMotor.Text = " Erro ao abrir o motor!"; } }
public static PriEngine CreatContext(string Company, string User, string Password) { StdBSConfApl objAplConf = new StdBSConfApl(); StdPlatBS Plataforma = new StdPlatBS(); ErpBS MotorLE = new ErpBS(); EnumTipoPlataforma objTipoPlataforma; objTipoPlataforma = EnumTipoPlataforma.tpEmpresarial; objAplConf.Instancia = "Default"; objAplConf.AbvtApl = "ERP"; objAplConf.PwdUtilizador = Password; objAplConf.Utilizador = User; objAplConf.LicVersaoMinima = "10.00"; StdBETransaccao objStdTransac = new StdBETransaccao(); try { Plataforma.AbrePlataformaEmpresa(Company, objStdTransac, objAplConf, objTipoPlataforma); } catch (Exception ex) { throw (ex); } if (Plataforma.Inicializada) { // Use this service to trigger the API events. ExtensibilityService service = new ExtensibilityService(); // Suppress all message box events from the API. // Plataforma.ExtensibilityLogger.AllowInteractivity = false; service.Initialize(MotorLE); // Check if service is operational if (service.IsOperational) { // Inshore that all extensions are loaded. service.LoadExtensions(); } MotorLE.AbreEmpresaTrabalho(objTipoPlataforma, Company, User, Password, objStdTransac, "Default"); Platform = Plataforma; Engine = MotorLE; EngineStatus = true; } return(engineInstance); }