public static ErpBS AbreEmpresa(string strEmpresa, string strUtilizador, string strPassword, string strInstancia)
        {
            //------------------------------------------------------------------------
            //Open plt
            //------------------------------------------------------------------------

            StdBSConfApl objAplConf = new StdBSConfApl();
            ErpBS        objMotor   = new ErpBS();

            //[ Open Plt 1ª time ]
            EnumTipoPlataforma objTipoPlataforma = new EnumTipoPlataforma();

            objTipoPlataforma = EnumTipoPlataforma.tpProfissional;

            objAplConf.Instancia     = strInstancia;
            objAplConf.AbvtApl       = "GCP";
            objAplConf.PwdUtilizador = "";
            objAplConf.Utilizador    = "";

            StdBETransaccao objStdTransac = new StdBETransaccao();

            Plataforma.AbrePlataformaEmpresaIntegrador(ref strEmpresa, ref objStdTransac, ref objAplConf, ref objTipoPlataforma);


            bool blnModoPrimario = true;

            objMotor.AbreEmpresaTrabalho(ref objTipoPlataforma, ref strEmpresa, ref strUtilizador, ref strPassword, ref objStdTransac, ref strInstancia, ref blnModoPrimario);

            MotorLE = objMotor;

            return(MotorLE);
        }
        public static bool InitializeCompany(string Company, string User, string Password)
        {
            StdBSConfApl objAplConf = new StdBSConfApl();
            StdPlatBS    Plataforma = new StdPlatBS();
            ErpBS        MotorLE    = new ErpBS();

            EnumTipoPlataforma objTipoPlataforma = new EnumTipoPlataforma();

            objTipoPlataforma = EnumTipoPlataforma.tpProfissional;

            objAplConf.Instancia     = "Default";
            objAplConf.AbvtApl       = "GCP";
            objAplConf.Utilizador    = User;
            objAplConf.PwdUtilizador = Password;


            StdBETransaccao objStdTransac = new StdBETransaccao();

            // Opem platform.
            Plataforma.AbrePlataformaEmpresaIntegrador(ref Company, ref objStdTransac, ref objAplConf, ref objTipoPlataforma);

            // Is plt initialized?
            if (Plataforma.Inicializada)
            {
                // Retuns the ptl.
                Platform = Plataforma;

                bool blnModoPrimario = true;

                // Open Engine
                MotorLE.AbreEmpresaTrabalho(EnumTipoPlataforma.tpProfissional, ref Company, ref User, ref Password, ref objStdTransac, "Default", ref blnModoPrimario);

                // Returns the engine.
                Engine = MotorLE;

                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#3
0
        public static bool InitializeCompany(string Company, string User, string Password)
        {
            StdBSConfApl objAplConf = new StdBSConfApl();
            StdPlatBS Plataforma = new StdPlatBS();
            ErpBS MotorLE = new ErpBS();

            EnumTipoPlataforma objTipoPlataforma = new EnumTipoPlataforma();
            objTipoPlataforma = EnumTipoPlataforma.tpProfissional;

            objAplConf.Instancia = "Default";
            objAplConf.AbvtApl = "GCP";
            objAplConf.PwdUtilizador = Password;
            objAplConf.Utilizador = User;

            StdBETransaccao objStdTransac = new StdBETransaccao();

            // Opem platform.
            Plataforma.AbrePlataformaEmpresaIntegrador(ref Company, ref objStdTransac, ref objAplConf, ref objTipoPlataforma);

            // Is plt initialized?
            if (Plataforma.Inicializada)
            {

                // Retuns the ptl.
                Platform = Plataforma;

                bool blnModoPrimario = true;

                // Open Engine
                MotorLE.AbreEmpresaTrabalho(EnumTipoPlataforma.tpProfissional, ref Company, ref User, ref Password, ref objStdTransac, "Default", ref blnModoPrimario);
                _connection = Plataforma.BaseDados.AbreBaseDadosADO("Default", "PRI" + Company);

                // Returns the engine.
                Engine = MotorLE;

                return true;
            }
            else
            {
                return false;
            }
        }