示例#1
0
        public Exit()
        {
            InitializeComponent();
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; // disables reshaping the form.
            MaximizeBox          = false;
            lbWarnings.Text      = "";
            visitorData          = new Visitor_DataHelper();
            returned             = new List <Classes.EquipmentShop>();
            items                = new List <BorrowedEquipment>();
            phidget              = new phidget();
            Equipmentdata        = new EquipmentShop_DH();
            borrowedEquimentData = new BorrowedEquipments_DH();

            try
            {
                phidget.OpenRFID();
                phidget.RFID.Tag += new RFIDTagEventHandler(AssignRFID);
                if (RFIDTagNr == null)
                {
                    lbRFIDStatus.Text = "Scan an RFID chip.";
                }
            }
            catch (Exception)
            {
                lbRFIDStatus.Text = "Error while opening the RFID reader.";
            }
        }
示例#2
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.";
            }
        }
示例#3
0
 private void DefineDataSource()
 {
     ticketData      = new DatabaseClasses.Ticket_DataHelper();
     campingSpotData = new DatabaseClasses.CampingSpot_DH();
     invoiceData     = new DatabaseClasses.Invoice_DH();
     VisitorData     = new DatabaseClasses.Visitor_DataHelper();
     boatdata        = new DatabaseClasses.Boat_DH();
     BORROWEDDATA    = new BorrowedEquipments_DH();
 }
示例#4
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);
            }
        }
示例#5
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.";
            }
        }