Exemplo n.º 1
0
        private void btnSignOut_Click(object sender, EventArgs e)
        {
            Visitor_DataHelper visitorData = new Visitor_DataHelper();

            if (RFIDTagNr != null)
            {
                lbRFIDStatus.Text = "";
                lbWarnings.Text   = "";

                Visitor visitor = GetVisitor(RFIDTagNr);
                BorrowedEquipments_DH BorrowedItemsData = new BorrowedEquipments_DH();

                items = BorrowedItemsData.GetBorrowedItems(visitor.EventID);

                if (visitor != null)
                {     // participant exists
                    if (visitor.PresentBalance == 0 && items.Count == 0)
                    { // no borrowed items and their balance is 0
                        visitorData.CheckOut(RFIDTagNr);
                        lbWarnings.Text = "Successfully CheckedOut";
                    }
                    else
                    {
                        lbWarnings.Text = "Check returned item & let the visitor go";
                    }
                }
            }
            else
            {
                lbRFIDStatus.Text = "Scan an RFID object.";
            }
        }
Exemplo n.º 2
0
        //private bool isHiredItems(Visitor visitor)
        //{
        //    BorrowedEquipments_DH itemsData = new BorrowedEquipments_DH();
        //    items = itemsData.GetBorrowedItems(visitor.EventID,visitor.RFID);

        //    if (items.Count > 0)
        //    {// there are some  items
        //        return true;
        //    }
        //    else
        //    {// no  items
        //        return false;
        //    }
        //}

        private void Status()
        {
            if (RFIDTagNr != null)
            {// RFID tag number is reader
             //    lbEquipment.Text = "";
             //   lbRemainingBlnc.Text = "";
                lbRFIDStatus.Text = RFIDTagNr;
                lbWarnings.Text   = "";

                Visitor            visitor     = GetVisitor(RFIDTagNr);
                Visitor_DataHelper visitorData = new Visitor_DataHelper();

                visitorData.CheckOut(RFIDTagNr);

                if (visitor != null)
                {                                                                // participant exists
                    lbRemainingBalance.Text = visitor.PresentBalance.ToString(); // display their balance


                    //    if (isHiredItems(visitor))
                    //    {
                    //   //     lbEquipment.Text = "Some items are not returned.";
                    //    }
                    //    else
                    //    {
                    //  //      lbEquipment.Text = "No hired items.";
                    //    }
                    //}
                    //else
                    //{
                    lbWarnings.Text = "RFID set to null.";
                }
            }
            else
            {
                lbRFIDStatus.Text = "ScanRFID";
            }
        }
Exemplo n.º 3
0
        private void btnSignOut_Click(object sender, EventArgs e)
        {
            Visitor_DataHelper visitorData = new Visitor_DataHelper();

            if (RFIDTagNr == null)
            {
                lbRFIDStatus.Text = "";
                lbWarnings.Text   = "";

                //   Visitor visitor = GetVisitor(RFIDTagNr);
                Visitor visitor = CheckForid();
                BorrowedEquipments_DH BorrowedItemsData = new BorrowedEquipments_DH();

                items = BorrowedItemsData.GetBorrowedItems(visitor.EventID, visitor.RFID);

                if (visitor != null)
                {     // participant exists
                    if (visitor.PresentBalance >= 0 && items.Count == 0)
                    { // no borrowed items and their balance is 0
                        visitorData.CheckOut(RFIDTagNr);
                        lbWarnings.Text = "Problem";
                        lbEventID.Text  = "Visitor Found";
                    }
                    else
                    {
                        lbWarnings.Text      = "No Hired Item found";
                        lbRemainingBlnc.Text = "" + visitor.PresentBalance;
                        lbEquipment.Text     = "" + "Returened\nlet the visitor go";
                    }
                }
            }
            else
            {
                lbRFIDStatus.Text = "Scan an RFID object.";
            }
        }