예제 #1
0
        private static void OpenGate(string openedby, SecureGateLog log, ContCard contCard)
        {
            try
            {
                if (_CaptureImageExeFile.Length > 0)
                {
                    System.Console.WriteLine("info: capturing container picture...");
                    Process.Start(_CaptureImageExeFile);
                    System.Console.WriteLine("info: container picture captured");
                    Thread.Sleep(1000);
                }
                else
                {
                    System.Console.WriteLine("warning: container picture not captured");
                }
            }
            catch (Exception exception)
            {
                System.Console.WriteLine("error: " + exception.Message);
            }
            try
            {
                var terminal = new Terminal(_SecureGateTelnetAddress, Convert.ToInt32(_SecureGateTelnetPort), 10, 80, 40); // hostname, port, timeout [s], width, height
                PushCommand.PushOK(terminal);

                Thread.Sleep(1000);
            }
            catch (Exception exception2)
            {
                System.Console.WriteLine("error: " + exception2.Message);
            }
            try
            {
                SecureGateLogDAL logDal = new SecureGateLogDAL();
                log.Loc1      = _SecureGateLocName;
                log.LogCat    = "GATE OPEN EVENT";
                log.LogRemark = openedby;
                log.RefID     = contCard.ContCardID;
                if (log.SecureGateLogID <= 0)
                {
                    logDal.DeleteSecureGateLog(log);
                    logDal.InsertSecureGateLog(log);
                }
                else
                {
                    logDal.UpdateSecureGateLog(log);
                }
            }
            catch (Exception exception3)
            {
                System.Console.WriteLine("error: " + exception3.Message);
            }
        }
예제 #2
0
        private static void OpenGate(string openedBy, SecureGateLog log, ContCard contCard, Terminal terminal)
        {
            try
            {
                if (_CaptureImageExeFile.Length > 0)
                {
                    System.Console.WriteLine("info: capturing container picture...");
                    Process.Start(_CaptureImageExeFile);
                    System.Console.WriteLine("info: container picture captured");
                    Thread.Sleep(1000);
                }
                else
                {
                    System.Console.WriteLine("warning: container picture not captured");
                }
            }
            catch (Exception exception)
            {
                System.Console.WriteLine("error: " + exception.Message);
            }
            try
            {
                PushCommand.PushOK(terminal);

                Thread.Sleep(1000);
            }
            catch (Exception exception2)
            {
                System.Console.WriteLine("error: " + exception2.Message);
            }
            try
            {
                SecureGateLogDAL logDal = new SecureGateLogDAL();
                log.Loc1      = _SecureGateLocName;
                log.LogCat    = "GATE OPEN EVENT";
                log.LogRemark = openedBy;
                log.RefID     = contCard.ContCardID;
                if (log.SecureGateLogID <= 0)
                {
                    logDal.DeleteSecureGateLog(log);
                    logDal.InsertSecureGateLog(log);
                }
                else
                {
                    logDal.UpdateSecureGateLog(log);
                }
            }
            catch (Exception exception3)
            {
                System.Console.WriteLine("error: " + exception3.Message);
            }
        }