示例#1
0
        private void CaptureDataFingerpint(int message)
        {
            switch (message)
            {
            case MESSAGE_CAPTURED_OK:
            {
                MemoryStream ms = new MemoryStream();
                BitmapFormat.GetBitmap(FPBuffer, mfpWidth, mfpHeight, ref ms);
                Bitmap bmp = new Bitmap(ms);

                // this is for testing, to check whether it receives a proper Bitmap data.
                //bmp.Save("test.bmp", ImageFormat.Png);

                String strShow = zkfp2.BlobToBase64(CapTmp, cbCapTmp);

                String current_dt = tk.GetCurrentDatetime();
                Console.WriteLine("----------------------");
                Console.WriteLine(current_dt);
                Console.WriteLine("----------------------");
                Console.WriteLine("captured data : " + strShow + "\n");

                Keyboard.AutoCopyPasteEvent(strShow);
            }
            break;

            default:
                Console.WriteLine("Error : Invalid Data Fingerprint.");
                break;
            }
        }
示例#2
0
        private void Clear()
        {
            nonCash.Checked           = true;
            tarifMuatan.SelectedIndex = 0;
            datetimeIn.Text           = TKHelper.GetCurrentDatetime();

            int countPedestrianTypeTextBox = PedestrianTypes.Count;

            if (countPedestrianTypeTextBox > 0)
            {
                foreach (var dataPedestrian in PedestrianTypes)
                {
                    string  type    = dataPedestrian.Key;
                    TextBox textBox = this.Controls.Find(type, true).FirstOrDefault() as TextBox;
                    textBox.Text = "";
                }
            }
            ComboBox comboBox = Controls.Find("comboBoxNote", true).FirstOrDefault() as ComboBox;

            comboBox.SelectedIndex = 0;

            CargoFare          = 0;
            GrandTotal         = 0;
            PedestrianFare     = 0;
            txtGrandTotal.Text = "0";
        }
示例#3
0
        public void Inventory()
        {
            int i;
            int CardNum = 0;
            int Totallen = 0;
            int EPClen, m;

            byte[] EPC = new byte[5000];
            int    CardIndex;
            string temps;
            string s, sEPC;
            bool   isonlistview;

            fIsInventoryScan = true;
            byte AdrTID  = 0;
            byte LenTID  = 0;
            byte TIDFlag = 0;

            fCmdRet = StaticClassReaderB.Inventory_G2(ref fComAdr, AdrTID, LenTID, TIDFlag, EPC, ref Totallen, ref CardNum, frmcomportindex);
            if ((fCmdRet == 1) | (fCmdRet == 2) | (fCmdRet == 3) | (fCmdRet == 4) | (fCmdRet == 0xFB))
            {
                byte[] daw = new byte[Totallen];
                //Console.WriteLine(daw);
                Array.Copy(EPC, daw, Totallen);
                temps = ByteArrayToHexString(daw);
                fInventory_EPC_List = temps;
                m = 0;
                //Console.WriteLine("Card Num : " + CardNum);
                if (CardNum == 0)
                {
                    fIsInventoryScan = false;
                    return;
                }
                else
                {
                    EPClen = daw[m];
                    sEPC   = temps.Substring(m * 2 + 2, EPClen * 2);

                    // Show UID Card
                    string EPC_Card = tk.ConvertEPCHexToNumber(sEPC);
                    Console.WriteLine("\n=========================");
                    Console.WriteLine(tk.GetCurrentDatetime());
                    Console.WriteLine("=========================");
                    Console.WriteLine("UID : " + EPC_Card);

                    // auto copy-paste feature
                    keyboard.AutoCopyPasteEvent(EPC_Card);
                }
            }
            fIsInventoryScan = false;
        }
示例#4
0
        public void Clear(bool include_uid = false)
        {
            if (include_uid)
            {
                supervisorCard.Text = "Tempel Kartu Supervisor";
            }
            plateNumber.Text   = "Nomor Plat Kendaraan";
            timeIn.Text        = "- - -  00:00:00";
            timeOut.Text       = TKHelper.GetCurrentDatetime();
            txtGrandTotal.Text = "0";
            barcode.Text       = "Scan Barcode";
            ResetComboBox();

            PictFace.Image       = Properties.Resources.no_image;
            PictFace.SizeMode    = PictureBoxSizeMode.StretchImage;
            PictVehicle.Image    = Properties.Resources.no_image;
            PictVehicle.SizeMode = PictureBoxSizeMode.StretchImage;
        }
示例#5
0
        private void InitData()
        {
            nonCash.Checked = true;
            datetimeIn.Text = TKHelper.GetCurrentDatetime();
            try
            {
                string masterDataFile = TKHelper.GetApplicationExecutableDirectoryName() + Constant.PATH_FILE_MASTER_DATA_PARKING_IN;
                using (StreamReader reader = new StreamReader(masterDataFile))
                {
                    string  json           = reader.ReadToEnd();
                    dynamic pedestrianData = JsonConvert.DeserializeObject(json);
                    foreach (var data in pedestrianData["pedestrian"])
                    {
                        string pedestrianName = data["name"];
                        int    pedestrianFare = data["fare"];
                        PedestrianTypes.Add(pedestrianName, pedestrianFare);
                    }

                    foreach (string data in pedestrianData["notes"])
                    {
                        FreePassTypes.Add(data);
                    }
                    string defaultText = "- Pilih Tipe Muatan -";
                    tarifMuatan.Items.Add(defaultText);
                    tarifMuatan.Items.Add("Tidak Ada Muatan");
                    tarifMuatan.SelectedIndex = 0;
                    foreach (var data in pedestrianData["cargo"])
                    {
                        string cargoName         = data["name"];
                        int    cargoFare         = data["fare"];
                        string CargoNameWithFare = String.Format("{0} - {1}", cargoName, TKHelper.IDRWithCurrency(cargoFare.ToString()));
                        Cargos.Add(CargoNameWithFare, cargoFare);
                        CargoTypes.Add(CargoNameWithFare, cargoName);
                        tarifMuatan.Items.Add(CargoNameWithFare);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_FAIL_TO_FETCH_PEDESTRIAN_DATA, ToolTipIcon.Error);
            }
        }
示例#6
0
        public void Clear(bool include_uid = false)
        {
            if (include_uid)
            {
                textBox1.Text = "Barcode/UID Kartu";
            }
            textBox2.Text      = "Nomor Plat Kendaraan";
            textBox3.Text      = "- - -  00:00:00";
            textBox4.Text      = TKHelper.GetCurrentDatetime();
            txtHour.Text       = "";
            txtMinute.Text     = "";
            txtSecond.Text     = "";
            txtGrandTotal.Text = "0";
            this.ResetComboBox();

            PictFace.Image       = Properties.Resources.no_image;
            PictFace.SizeMode    = PictureBoxSizeMode.StretchImage;
            PictVehicle.Image    = Properties.Resources.no_image;
            PictVehicle.SizeMode = PictureBoxSizeMode.StretchImage;

            nonCash.Checked = true;
        }
示例#7
0
 private void TimerTick(object sender, EventArgs e)
 {
     textBox4.Text = TKHelper.GetCurrentDatetime();
 }
示例#8
0
        public string DeductBalance(string bank, string ipv4, string TIDSettlement, string operator_name, int amount = 1)
        {
            try
            {
                // check if deducted amount is sufficient within balance range and the balance must be greater than 0
                int cardBalance = Int32.Parse(this.GetCardBalance());
                if (cardBalance > 0 && (cardBalance - amount) > 0)
                {
                    string result = bni.debitProcess(this.readerList[2].ToString(), this.selectedReader.ToString(), amount, Properties.Settings.Default.TID);

                    // store deduct result card to server
                    string created = tk.ConvertDatetimeToDefaultFormat(tk.GetCurrentDatetime());
                    string query   = "INSERT INTO deduct_card_results (result, amount, transaction_dt, bank, ipv4, operator, ID_reader, created) VALUES('" + result + "', '" + amount +
                                     "', '" + created + "', '" + bank + "', '" + ipv4 + "', '" + operator_name + "', '" + TIDSettlement + "', '" + created + "')";
                    try
                    {
                        database.Insert(query);

                        Console.WriteLine("Successfully Deducted for Rp. " + amount + ",-.");
                        Console.WriteLine("Current Balance : " + String.Format("{0:n}", Int32.Parse(this.GetCardBalance())));

                        //this.CreateSettlement(result);

                        acr123u.connectDirect();
                        int repeat      = 3;
                        int onDuration  = 5;
                        int OffDuration = 10;
                        acr123u.setBuzzerControl((byte)repeat, (byte)onDuration, (byte)OffDuration);
                        this.LEDStatus  = LEDGreen;
                        this.LEDStatus |= LEDAntGreen;
                        acr123u.LCDBacklightControl(0xFF);
                        this.acr123u.setLEDControl(this.LEDStatus);
                        this.SetLCDDisplayText("Success ...");
                        acr123u.disconnect();

                        return("OK");
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                        return(ex.Message);
                    }
                }
                else
                {
                    acr123u.connectDirect();
                    this.SetLCDDisplayText("Insufficient Bal");
                    Console.WriteLine("Can't Deduct : Insufficient Balance.");
                    int repeat      = 2;
                    int onDuration  = 5;
                    int OffDuration = 10;
                    acr123u.setBuzzerControl((byte)repeat, (byte)onDuration, (byte)OffDuration);
                    this.LEDStatus  = LEDRed;
                    this.LEDStatus |= LEDAntRed;
                    acr123u.LCDBacklightControl(0xFF);
                    this.acr123u.setLEDControl(this.LEDStatus);
                    acr123u.disconnect();
                    return("Can't Deduct : Insufficient Balance.");
                }
            }
            catch (Exception ex)
            {
                acr123u.connectDirect();
                this.SetLCDDisplayText("Fail to Process.");
                Console.WriteLine(ex.Message);
                int repeat      = 2;
                int onDuration  = 5;
                int OffDuration = 10;
                acr123u.setBuzzerControl((byte)repeat, (byte)onDuration, (byte)OffDuration);
                this.LEDStatus  = LEDRed;
                this.LEDStatus |= LEDAntRed;
                acr123u.LCDBacklightControl(0xFF);
                this.acr123u.setLEDControl(this.LEDStatus);
                acr123u.disconnect();
                return(ex.Message);
            }
        }