Ejemplo n.º 1
0
        public static void DIConnect()
        {
            if (!DIApplication.Connected)
            {
                DIConnection lObjDIConnection = new DIConnection();
                lObjDIConnection.ConnectToDI(GetCredentials());

                if (lObjDIConnection.Company != null && lObjDIConnection.Company.Connected)
                {
                    DIApplication.DIConnect(lObjDIConnection.Company);
                }
            }
        }
Ejemplo n.º 2
0
        public static void DIReconnect()
        {
            try
            {
                if (Company != null)
                {
                    Company.Disconnect();
                    MemoryUtility.ReleaseComObject(Company);
                }
            }
            catch (Exception lObjException)
            {
                LogUtility.WriteException(lObjException);
            }

            DIConnection lObjDIConnection = new DIConnection();

            lObjDIConnection.ConnectToDI(GetCredentials());

            if (lObjDIConnection.Company != null && lObjDIConnection.Company.Connected)
            {
                DIApplication.DIConnect(lObjDIConnection.Company);
            }
        }