コード例 #1
0
 private void btnDisableDevice_Click(object sender, EventArgs e)
 {
     // This is of no use since i implemented zkemKeeper the other way
     bool deviceDisabled = objZkeeper.DisableDeviceWithTimeOut(int.Parse(tbxMachineNumber.Text.Trim()), 3000);
 }
コード例 #2
0
        private void btnDisableDevice_Click(object sender, EventArgs e)
        {
            bool deviceDisabled = objZkeeper.DisableDeviceWithTimeOut(1, 3000);

            InsertarEvento("El usuario " + usuario + " ha desabilitado la terminal " + marcadores[Convert.ToInt32(cmbUbicacion.SelectedIndex)].UBICACION);
        }
コード例 #3
0
        private void tsm_baglan_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                ShowStatusBar("Bağlantı Kuruluyor.", true);

                if (IsDeviceConnected)
                {
                    IsDeviceConnected = false;
                    this.Cursor       = Cursors.Default;
                    //enable device
                    if (checkBox1.Checked)
                    {
                        bool deviceEnabled = objZkeeper.EnableDevice(int.Parse(toolStripTextBox3.Text.Trim()), true);
                    }
                    return;
                }

                string ipAddress = toolStripTextBox1.Text.Trim();
                string port      = toolStripTextBox2.Text.Trim();
                if (ipAddress == string.Empty || port == string.Empty)
                {
                    throw new Exception("The Device IP Address and Port is mandotory !!");
                }

                int portNumber = 4370;
                if (!int.TryParse(port, out portNumber))
                {
                    throw new Exception("Not a valid port number");
                }

                bool isValidIpA = UniversalStatic.ValidateIP(ipAddress);
                if (!isValidIpA)
                {
                    throw new Exception("The Device IP is invalid !!");
                }

                isValidIpA = UniversalStatic.PingTheDevice(ipAddress);
                if (!isValidIpA)
                {
                    throw new Exception("The device at " + ipAddress + ":" + port + " did not respond!!");
                }

                objZkeeper        = new ZkemClient(RaiseDeviceEvent);
                IsDeviceConnected = objZkeeper.Connect_Net(ipAddress, portNumber);

                if (IsDeviceConnected)
                {
                    string deviceInfo = manipulator.FetchDeviceInfo(objZkeeper, int.Parse(toolStripTextBox3.Text.Trim()));
                    this.Text = "Ana Menü - " + deviceInfo;
                }
                machineNumber = toolStripTextBox3.Text;

                //disable device
                if (checkBox1.Checked)
                {
                    bool deviceDisabled = objZkeeper.DisableDeviceWithTimeOut(int.Parse(toolStripTextBox3.Text.Trim()), 3000);
                }
            }
            catch (Exception ex)
            {
                ShowStatusBar(ex.Message, false);
            }
            this.Cursor = Cursors.Default;
        }
コード例 #4
0
 private void DisableDevice(ZkemClient objZkeeper, Device device)
 {
     // This is of no use since i implemented zkemKeeper the other way
     bool deviceDisabled = objZkeeper.DisableDeviceWithTimeOut(int.Parse(device.DeviceId), 3000);
 }