public EquipmentShop() { InitializeComponent(); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; // disables reshaping the form. MaximizeBox = false; visitordata = new Visitor_DataHelper(); orders = new List <Classes.EquipmentShop>(); returned = new List <Classes.EquipmentShop>(); Equipment = new DatabaseClasses.EquipmentShop_DH(); phidget = new phidget(); try { phidget.OpenRFID(); phidget.RFID.Tag += new RFIDTagEventHandler(AssignARFID); if (RFIDTagNr == null) { MessageBox.Show("Please scan Rfid."); } } catch (Exception) { MessageBox.Show("Error opening the RFID reader."); } }
public EventEntrance() { InitializeComponent(); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; // disables reshaping the form. MaximizeBox = false; lbGreetings.Text = ""; lbWarning.Text = ""; phidget = new phidget(); visitorData = new Visitor_DataHelper(); try { phidget.OpenRFID(); //phidget.RFID.Tag += new TagEventHandler(AssignRFID); if (RFIDTagNr == null) { textBox1.Text = RFIDTagNr; } } catch (Exception) { lbRFIDStatus.Text = "There was an error opening the Rfid Reader."; } }
//private string SetReturndate(int id) //{ // string b = returndate.ToShortDateString(); // bool updated = borrowedEquimentData.GetAITEM(id); // if (updated) // { // return "SuccessFully Returned."; // } // else // { // return "no hired items"; // } //} 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(); 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 = "visitor doesn't exist."; } } else { lbRFIDStatus.Text = "Scan an RFID chip."; } }
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."; } }
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."; } }
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(); }
private void timer1_Tick(object sender, EventArgs e) { Visitor_DataHelper visitorData = new Visitor_DataHelper(); timer1.Interval = 3000; timer1.Enabled = true; int nr = visitorData.GetPresentParticipants(); //if (nr > -1) //{ // totalVisitors.Text = nr.ToString(); //} }
//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"; } }
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."; } }
private Visitor GetVisitor(string RFID) { Visitor_DataHelper visitorData = new Visitor_DataHelper(); return(visitorData.GetVisitor(RFID)); }
public EquipmentShop() { InitializeComponent(); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; // disables reshaping the form. MaximizeBox = false; visitordata = new Visitor_DataHelper(); orders = new List <Classes.EquipmentsShop>(); returned = new List <Classes.EquipmentsShop>(); Equipment = new DatabaseClasses.EquipmentShop_DH(); foreach (var v in Equipment.GetEquipments()) { if (v.ItemID == 1) { charger1.Text = v.Name; } if (v.ItemID == 2) { Charger2.Text = v.Name; } if (v.ItemID == 3) { Charger3.Text = v.Name; } if (v.ItemID == 4) { Charger4.Text = v.Name; } if (v.ItemID == 5) { usb5.Text = v.Name; } if (v.ItemID == 6) { usb6.Text = v.Name; } if (v.ItemID == 7) { USB7.Text = v.Name; } if (v.ItemID == 8) { USB8.Text = v.Name; } if (v.ItemID == 9) { cable9.Text = v.Name; } if (v.ItemID == 10) { CABLE10.Text = v.Name; } if (v.ItemID == 11) { CABLE11.Text = v.Name; } if (v.ItemID == 12) { CABLE12.Text = v.Name; } if (v.ItemID == 13) { camera13.Text = v.Name; } if (v.ItemID == 14) { CAMERA14.Text = v.Name; } if (v.ItemID == 15) { CAMERA15.Text = v.Name; } if (v.ItemID == 16) { CAMERA16.Text = v.Name; } } phidget = new phidget(); try { phidget.OpenRFID(); phidget.RFID.Tag += new RFIDTagEventHandler(AssignARFID); } catch (Exception) { MessageBox.Show("Error opening the RFID reader."); } // MessageBox.Show("Note:itemNr has to be assigned to a product according to the button itemnr"); }