Exemplo n.º 1
0
        private void RequestFineFarePerVehicle(string vehicle)
        {
            string             requestFineApiUrl = Properties.Resources.RequestFineFareAPIURL;
            FineFareRequest    fineFareRequest   = new FineFareRequest(vehicle);
            var                payload           = JsonConvert.SerializeObject(fineFareRequest);
            DataResponseObject response          = (DataResponseObject)restApi.post(ipAddressServer, requestFineApiUrl, true, payload);

            if (response != null)
            {
                if (response.Status == 206)
                {
                    FineFare fineFare   = JsonConvert.DeserializeObject <FineFare>(response.Data.ToString());
                    string   chargeFare = fineFare.ChargeFare.ToString();
                    txtGrandTotal.Text = TKHelper.IDR(chargeFare);
                    string   datetimeOut = fineFare.DatetimeOut.ToString();
                    string[] temp_dt_out = datetimeOut.Split(' ');
                    waktu_keluar.Text = TKHelper.ConvertDatetime(temp_dt_out[0], temp_dt_out[1]);
                }
                else
                {
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Warning", response.Message, ToolTipIcon.Warning);
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_FAIL_TO_CONNECT_SERVER, ToolTipIcon.Error);
            }
        }
Exemplo n.º 2
0
        private ParkingOut SendDataToServer(string webcamCapturedImage, string liveCameraSnapshotImage, string paymentMethod, int totalFare)
        {
            string vehicle     = tipe_kendaraan.SelectedItem.ToString();
            string username    = Properties.Settings.Default.Username;
            string datetimeOut = TKHelper.ConvertDatetimeToDefaultFormat(waktu_keluar.Text.ToString());
            string plateNumber = nomor_plat.Text.ToString();
            string ipAddress   = TKHelper.GetLocalIPAddress();

            LostTicketRequest lostTicketRequest = new LostTicketRequest(vehicle, username, datetimeOut, totalFare, plateNumber, ipAddress, paymentMethod, webcamCapturedImage, liveCameraSnapshotImage);
            var payload = JsonConvert.SerializeObject(lostTicketRequest);

            string lostTicketApiUrl = Properties.Resources.LostTicketAPIURL;

            DataResponseObject response = (DataResponseObject)restApi.post(ipAddressServer, lostTicketApiUrl, true, payload);

            if (response != null)
            {
                if (response.Status == 206)
                {
                    return(JsonConvert.DeserializeObject <ParkingOut>(response.Data.ToString()));
                }
                else
                {
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Warning", response.Message, ToolTipIcon.Warning);
                    return(null);
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_INVALID_RESPONSE_FROM_SERVER, ToolTipIcon.Error);
                return(null);
            }
        }
Exemplo n.º 3
0
        private void tipe_kendaraan_SelectionChangeCommitted(object sender, EventArgs e)
        {
            if (tipe_kendaraan.SelectedIndex != 0)
            {
                var    ApiUrl      = Properties.Resources.RequestVehicleFarePassKadeAPIURL;
                string vehicleType = tipe_kendaraan.Text;
                PassKadeInVehicleFareRequest passKadeInVehicleFareRequest = new PassKadeInVehicleFareRequest(vehicleType);
                var sentParam = JsonConvert.SerializeObject(passKadeInVehicleFareRequest);

                DataResponseObject response = (DataResponseObject)restApi.post(IpAddressServer, ApiUrl, true, sentParam);
                if (response != null)
                {
                    if (response.Status == 206)
                    {
                        PassKadeInVehicleFare passKadeInVehicleFare = JsonConvert.DeserializeObject <PassKadeInVehicleFare>(response.Data.ToString());

                        txtPassKadeFare.Text = TKHelper.IDR(passKadeInVehicleFare.Fare.ToString());
                        VehicleFare          = passKadeInVehicleFare.Fare;
                        int grandTotal = VehicleFare + CargoFare;
                        txtGrandTotal.Text = TKHelper.IDR(grandTotal.ToString());

                        string[] departure = passKadeInVehicleFare.DepartureDatetime.Split(' ');
                        departureDatetime.Text = TKHelper.ConvertDatetime(departure[0], departure[1]);
                    }
                    else
                    {
                        notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", response.Message, ToolTipIcon.Error);
                    }
                }
                else
                {
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_FAIL_TO_CONNECT_SERVER, ToolTipIcon.Error);
                }
            }
        }
Exemplo n.º 4
0
        private PassKadeDeparture SendDataToServer(string base64WebcamImage, string base64IpCameraImage, string paymentMethod, string bankCode = "")
        {
            int    vehicleFare = TKHelper.IDRToNominal(txtPassKadeFare.Text.ToString());
            string uid         = ticket.Text.ToString();
            string uidType     = TKHelper.GetUidType(uid);
            string vehicleType = tipe_kendaraan.Text.ToString();
            string departure   = TKHelper.ConvertDatetimeToDefaultFormat(departureDatetime.Text.ToString());
            string username    = Properties.Settings.Default.Username;
            string plateNumber = nomor_plat.Text.ToString();
            string IpAddress   = TKHelper.GetLocalIPAddress();
            string cargoType   = TKHelper.DictionaryGetValueByKey(outloadTypeDict, tarifMuatan.Text.ToString());
            PassKadeDepartureRequest passKadeDepartureRequest = new PassKadeDepartureRequest(uidType, uid, vehicleType, departure, username, plateNumber, vehicleFare, CargoFare, cargoType, IpAddress, paymentMethod, bankCode, base64WebcamImage, base64IpCameraImage);
            var sentParam = JsonConvert.SerializeObject(passKadeDepartureRequest);

            string             passKadeDepartureRequestApiUrl = Properties.Resources.SaveDataPassKadeDepartureApiUrl;
            DataResponseObject response = (DataResponseObject)restApi.post(IpAddressServer, passKadeDepartureRequestApiUrl, true, sentParam);

            if (response != null)
            {
                if (response.Status == 206)
                {
                    return(JsonConvert.DeserializeObject <PassKadeDeparture>(response.Data.ToString()));
                }
                else
                {
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Warning", response.Message, ToolTipIcon.Warning);
                    return(null);
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_INVALID_RESPONSE_FROM_SERVER, ToolTipIcon.Error);
                return(null);
            }
        }
Exemplo n.º 5
0
        private DataPedestrianCargoResponse SendDataToServer(string paymentMethod, string bankCode = "")
        {
            List <DataPedestrianTypeQuantity> dataPedestrianTypeQuantities = GetDataPedestrianTypeQuantities();
            string IpAddress  = TKHelper.GetLocalIPAddress();
            string DatetimeIn = TKHelper.ConvertDatetimeToDefaultFormat(datetimeIn.Text.ToString());
            string Username   = Properties.Settings.Default.Username;
            string CargoType  = TKHelper.DictionaryGetValueByKey(CargoTypes, tarifMuatan.Text.ToString());

            PedestrianRequest pedestrianRequest = new PedestrianRequest(dataPedestrianTypeQuantities, IpAddress, DatetimeIn, Username, CargoFare, CargoType, paymentMethod, bankCode);
            var sentParam = JsonConvert.SerializeObject(pedestrianRequest);

            DataResponseObject response = (DataResponseObject)restApi.post(Properties.Settings.Default.IPAddressServer, Properties.Resources.SaveDataPedestrianApiUrl, true, sentParam);

            if (response != null)
            {
                switch (response.Status)
                {
                case 206:
                    return(JsonConvert.DeserializeObject <DataPedestrianCargoResponse>(response.Data.ToString()));

                default:
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Warning", response.Message, ToolTipIcon.Warning);
                    return(null);
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_INVALID_RESPONSE_FROM_SERVER, ToolTipIcon.Error);
                return(null);
            }
        }
Exemplo n.º 6
0
        private ParkingOut SendDataToServer(string base64Image, string base64LiveCameraSnapshotImage)
        {
            string dataBarcode     = barcode.Text.ToString();
            string uid             = supervisorCard.Text.ToString();
            string uidType         = TKHelper.GetUidType(dataBarcode);
            string vehicle         = vehicleType.Text.ToString();
            string datetimeOut     = TKHelper.ConvertDatetimeToDefaultFormat(timeOut.Text.ToString());
            string username        = Properties.Settings.Default.Username;
            string dataPlateNumber = plateNumber.Text.ToString();
            string ipAddressLocal  = TKHelper.GetLocalIPAddress();
            ParkingOutFreePassRequest freePassRequest = new ParkingOutFreePassRequest(vehicle, uidType, dataBarcode, username, datetimeOut, dataPlateNumber, ipAddressLocal, uid, base64Image, base64LiveCameraSnapshotImage);
            var sent_param = JsonConvert.SerializeObject(freePassRequest);

            DataResponseObject response = (DataResponseObject)restApi.post(ip_address_server, Properties.Resources.SaveDataFreePassAPIURL, true, sent_param);

            if (response != null)
            {
                switch (response.Status)
                {
                case 206:
                    return(JsonConvert.DeserializeObject <ParkingOut>(response.Data.ToString()));

                default:
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Warning", response.Message, ToolTipIcon.Warning);
                    return(null);
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_INVALID_RESPONSE_FROM_SERVER, ToolTipIcon.Error);
                return(null);
            }
        }
Exemplo n.º 7
0
        private void PrintReportOperator()
        {
            string             generateReportApiUrl = Properties.Resources.GenerateReportAPIURL;
            PrintReportRequest printReportRequest   = new PrintReportRequest(Properties.Settings.Default.Username);
            var sentParam = JsonConvert.SerializeObject(printReportRequest);
            DataResponseObject response = (DataResponseObject)restApi.post(ip_address_server, generateReportApiUrl, true, sentParam);

            if (response != null)
            {
                switch (response.Status)
                {
                case 206:
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Success", Constant.PRINT_REPORT_OPERATOR_SUCCESS, ToolTipIcon.Info);
                    break;

                case 208:
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Success", response.Message, ToolTipIcon.Warning);
                    break;

                default:
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Success", response.Message, ToolTipIcon.Error);
                    break;
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_INVALID_RESPONSE_FROM_SERVER, ToolTipIcon.Error);
            }
        }
Exemplo n.º 8
0
        private PassKadeOutResponse SendDataToServer(int totalFare, string base64Image, string base64LiveCameraImage, string paymentMethod, string bankCode = "")
        {
            string             vehicle            = tipe_kendaraan.Text.ToString();
            string             username           = Properties.Settings.Default.Username;
            string             plateNumber        = nomor_plat.Text.ToString();
            string             ipAddressLocal     = TKHelper.GetLocalIPAddress();
            string             noteValue          = note.Text.ToString();
            PassKadeOutRequest passKadeOutRequest = new PassKadeOutRequest(vehicle, datetimeOut, username, plateNumber, totalFare, noteValue, ipAddressLocal, paymentMethod, bankCode, base64Image, base64LiveCameraImage);
            var sent_param = JsonConvert.SerializeObject(passKadeOutRequest);

            DataResponseObject response = (DataResponseObject)restApi.post(IpAddressServer, Properties.Resources.SaveDataPassKadeOutApiUrl, true, sent_param);

            if (response != null)
            {
                switch (response.Status)
                {
                case 206:
                    return(JsonConvert.DeserializeObject <PassKadeOutResponse>(response.Data.ToString()));

                default:
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Warning", response.Message, ToolTipIcon.Warning);
                    return(null);
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_INVALID_RESPONSE_FROM_SERVER, ToolTipIcon.Error);
                return(null);
            }
        }
Exemplo n.º 9
0
        private ParkingOut SendDataToServer(int totalFare, string base64Image, string base64LiveCameraImage, string paymentMethod, string bankCode = "")
        {
            string            uid               = textBox1.Text.ToString();
            string            uidType           = TKHelper.GetUidType(uid);
            string            vehicle           = comboBox1.Text.ToString();
            string            datetimeOut       = TKHelper.ConvertDatetimeToDefaultFormat(textBox4.Text.ToString());
            string            username          = Properties.Settings.Default.Username;
            string            plateNumber       = textBox2.Text.ToString();
            string            ipAddressLocal    = TKHelper.GetLocalIPAddress();
            ParkingOutRequest parkingOutRequest = new ParkingOutRequest(uidType, uid, vehicle, datetimeOut, username, plateNumber, totalFare, ipAddressLocal, paymentMethod, bankCode, base64Image, base64LiveCameraImage);
            var sent_param = JsonConvert.SerializeObject(parkingOutRequest);

            DataResponseObject response = (DataResponseObject)restApi.post(ip_address_server, Properties.Resources.SaveDataParkingAPIURL, true, sent_param);

            if (response != null)
            {
                switch (response.Status)
                {
                case 206:
                    return(JsonConvert.DeserializeObject <ParkingOut>(response.Data.ToString()));

                default:
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Warning", response.Message, ToolTipIcon.Warning);
                    return(null);
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Warning", Constant.ERROR_MESSAGE_INVALID_RESPONSE_FROM_SERVER, ToolTipIcon.Warning);
                return(null);
            }
        }
Exemplo n.º 10
0
        private bool PullDataParkingIn()
        {
            string             APIPullData = Properties.Resources.RequestDataParkingPedestrianAPIURL;
            DataResponseObject response    = (DataResponseObject)restApi.get(ip_address_server, APIPullData, true);

            if (response != null)
            {
                if (response.Status == 206)
                {
                    ParkingInPedestrian parkingInPedestrian = JsonConvert.DeserializeObject <ParkingInPedestrian>(response.Data.ToString());
                    if (TKHelper.WriteDataIntoJSONFile(parkingInPedestrian, Constant.DIR_PATH_SOURCE, Constant.PATH_FILE_MASTER_DATA_PARKING_IN))
                    {
                        return(true);
                    }
                    else
                    {
                        notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_FAIL_TO_WRITE_MASTER_DATA_FILE, ToolTipIcon.Error);
                        return(false);
                    }
                }
                else
                {
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", response.Message, ToolTipIcon.Error);
                    return(false);
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_FAIL_TO_CONNECT_SERVER, ToolTipIcon.Error);
                return(false);
            }
        }
Exemplo n.º 11
0
        private void CheckCard(string SupervisorUIDCard)
        {
            string             ApiUrl   = Properties.Resources.CheckSupervisorCardAPIURL + SupervisorUIDCard;
            DataResponseObject response = (DataResponseObject)restApi.get(ip_address_server, ApiUrl, true);

            if (response != null)
            {
                if (response.Status != 200)
                {
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Warning", response.Message, ToolTipIcon.Warning);
                    UIDCard = "Tempel Kartu Supervisor";
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_INVALID_RESPONSE_FROM_SERVER, ToolTipIcon.Error);
            }
        }
Exemplo n.º 12
0
        private void ReprintTicket()
        {
            string             reprintTicketApiUrl = Properties.Resources.ReprintTicketAPIURL;
            DataResponseObject response            = (DataResponseObject)restApi.get(ip_address_server, reprintTicketApiUrl, true);

            if (response != null)
            {
                if (response.Status == 206)
                {
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Success", Constant.REPRINT_TICKET_SUCCESS, ToolTipIcon.Info);
                }
                else
                {
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", response.Message, ToolTipIcon.Error);
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_INVALID_RESPONSE_FROM_SERVER, ToolTipIcon.Error);
            }
        }
Exemplo n.º 13
0
        private bool CheckGate()
        {
            string             CheckGateApiUrl = Properties.Resources.CheckGateAPIURL;
            DataResponseObject response        = (DataResponseObject)restApi.get(this.ip_address_server, CheckGateApiUrl, true);

            if (response != null)
            {
                switch (response.Status)
                {
                case 206:
                    string data = response.Data.ToString();
                    Gate   gate = JsonConvert.DeserializeObject <Gate>(data);

                    Properties.Settings.Default.GateID                = gate.Id;
                    Properties.Settings.Default.GateName              = gate.Name;
                    Properties.Settings.Default.GateType              = gate.Type;
                    Properties.Settings.Default.UriAddressLiveCamera  = gate.RtspUri;
                    Properties.Settings.Default.UriSnapshotLiveCamera = gate.SnapshotUri;
                    Properties.Settings.Default.WebcamEnabled         = gate.WebcamEnabled;
                    Properties.Settings.Default.WebcamWidth           = gate.WebcamWidth;
                    Properties.Settings.Default.WebcamHeight          = gate.WebcamHeight;

                    return(true);

                case 401:
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Warning", Constant.ERROR_MESSAGE_INVALID_GATE, ToolTipIcon.Warning);
                    return(false);

                default:
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", response.Message, ToolTipIcon.Error);
                    return(false);
                }
            }
            else
            {
                notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_FAIL_TO_CONNECT_SERVER, ToolTipIcon.Error);
                return(false);
            }
        }
Exemplo n.º 14
0
        private void vehicleType_SelectionChangeCommitted(object sender, EventArgs e)
        {
            if (vehicleType.SelectedIndex != 0)
            {
                // send data API
                var APIUrl = Properties.Resources.RequestDataParkingFreePassAPIURL;

                string barcodeData = barcode.Text.ToString();
                string uidType     = TKHelper.GetUidType(barcodeData);

                FreePassRequest freePassRequest = new FreePassRequest(uidType, barcodeData);
                var             sent_param      = JsonConvert.SerializeObject(freePassRequest);

                DataResponseObject response = (DataResponseObject)restApi.post(ip_address_server, APIUrl, true, sent_param);
                if (response != null)
                {
                    switch (response.Status)
                    {
                    case 206:
                        parkingIn = JsonConvert.DeserializeObject <ParkingIn>(response.Data.ToString());

                        txtGrandTotal.Text = TKHelper.IDR(parkingIn.Fare.ToString());

                        string[] datetimeIn = parkingIn.DatetimeIn.Split(' ');
                        timeIn.Text = TKHelper.ConvertDatetime(datetimeIn[0], datetimeIn[1]);

                        string[] datetimeOut = parkingIn.DatetimeOut.Split(' ');
                        timeOut.Text = TKHelper.ConvertDatetime(datetimeOut[0], datetimeOut[1]);

                        // Load Picture of face and plate number
                        string faceImage = parkingIn.FaceImage;
                        if (string.IsNullOrEmpty(faceImage))
                        {
                            PictFace.Image = Properties.Resources.no_image;
                        }
                        else
                        {
                            try
                            {
                                string URL_pict_face = Constant.URL_PROTOCOL + Properties.Settings.Default.IPAddressServer + Properties.Resources.repo + "/" + faceImage;
                                PictFace.Load(URL_pict_face);
                            }
                            catch (Exception)
                            {
                                PictFace.Image = Properties.Resources.no_image;
                            }
                        }
                        PictFace.BackgroundImageLayout = ImageLayout.Stretch;
                        PictFace.SizeMode = PictureBoxSizeMode.StretchImage;

                        string plateNumberImage = parkingIn.PlateNumberImage;
                        if (string.IsNullOrEmpty(plateNumberImage))
                        {
                            PictVehicle.Image = Properties.Resources.no_image;
                        }
                        else
                        {
                            try
                            {
                                string URL_pict_vehicle = Constant.URL_PROTOCOL + Properties.Settings.Default.IPAddressServer + Properties.Resources.repo + "/" + parkingIn.PlateNumberImage;
                                PictVehicle.Load(URL_pict_vehicle);
                            }
                            catch (Exception)
                            {
                                PictVehicle.Image = Properties.Resources.no_image;
                            }
                        }
                        PictVehicle.BackgroundImageLayout = ImageLayout.Stretch;
                        PictVehicle.SizeMode = PictureBoxSizeMode.StretchImage;
                        break;

                    default:
                        notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", response.Message, ToolTipIcon.Error);
                        Clear();
                        break;
                    }
                }
                else
                {
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_FAIL_TO_CONNECT_SERVER, ToolTipIcon.Error);
                }
            }
        }
Exemplo n.º 15
0
        private void comboBox1_SelectionChangeCommitted(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex != 0)
            {
                if (textBox1.Text != "" && textBox1.Text != "Barcode/UID Kartu")
                {
                    // send data API
                    var APIUrl = Properties.Resources.RequestUIDFareAPIURL;

                    string             uidType     = TKHelper.GetUidType(UIDCard);
                    string             vehicle     = comboBox1.Text.ToString();
                    RequestFareRequest requestFare = new RequestFareRequest(uidType, UIDCard, vehicle);
                    var sent_param = JsonConvert.SerializeObject(requestFare);

                    DataResponseObject response = (DataResponseObject)restApi.post(ip_address_server, APIUrl, true, sent_param);
                    if (response != null)
                    {
                        switch (response.Status)
                        {
                        case 206:
                            parkingIn = JsonConvert.DeserializeObject <ParkingIn>(response.Data.ToString());

                            txtHour.Text   = TKHelper.GetValueTime(parkingIn.ParkDuration, "hour");
                            txtMinute.Text = TKHelper.GetValueTime(parkingIn.ParkDuration, "minute");
                            txtSecond.Text = TKHelper.GetValueTime(parkingIn.ParkDuration, "second");

                            txtGrandTotal.Text = TKHelper.IDR(parkingIn.Fare.ToString());

                            string[] datetimeIn = parkingIn.DatetimeIn.Split(' ');
                            textBox3.Text = TKHelper.ConvertDatetime(datetimeIn[0], datetimeIn[1]);

                            string[] datetimeOut = parkingIn.DatetimeOut.Split(' ');
                            textBox4.Text = TKHelper.ConvertDatetime(datetimeOut[0], datetimeOut[1]);

                            // Load Picture of face and plate number
                            string faceImage = parkingIn.FaceImage;
                            if (string.IsNullOrEmpty(faceImage))
                            {
                                PictFace.Image = Properties.Resources.no_image;
                            }
                            else
                            {
                                try
                                {
                                    string URL_pict_face = Constant.URL_PROTOCOL + Properties.Settings.Default.IPAddressServer + Properties.Resources.repo + "/" + faceImage;
                                    PictFace.Load(URL_pict_face);
                                }
                                catch (Exception)
                                {
                                    PictFace.Image = Properties.Resources.no_image;
                                }
                            }
                            PictFace.BackgroundImageLayout = ImageLayout.Stretch;
                            PictFace.SizeMode = PictureBoxSizeMode.StretchImage;

                            string plateNumberImage = parkingIn.PlateNumberImage;
                            if (string.IsNullOrEmpty(plateNumberImage))
                            {
                                PictVehicle.Image = Properties.Resources.no_image;
                            }
                            else
                            {
                                try
                                {
                                    string URL_pict_vehicle = Constant.URL_PROTOCOL + Properties.Settings.Default.IPAddressServer + Properties.Resources.repo + "/" + parkingIn.PlateNumberImage;
                                    PictVehicle.Load(URL_pict_vehicle);
                                }
                                catch (Exception)
                                {
                                    PictVehicle.Image = Properties.Resources.no_image;
                                }
                            }
                            PictVehicle.BackgroundImageLayout = ImageLayout.Stretch;
                            PictVehicle.SizeMode = PictureBoxSizeMode.StretchImage;
                            break;

                        default:
                            notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", response.Message, ToolTipIcon.Error);
                            Clear();
                            break;
                        }
                    }
                    else
                    {
                        notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.ERROR_MESSAGE_FAIL_TO_CONNECT_SERVER, ToolTipIcon.Error);
                    }
                }
                else
                {
                    notifyIcon.ShowBalloonTip(Constant.NOTIFICATION_TRAY_TIMEOUT, "Error", Constant.WARNING_MESSAGE_UNTAPPED_CARD, ToolTipIcon.Error);
                    this.ResetComboBox();
                    return;
                }
            }
        }