public void VisitorCheckedStatus(object sender, RFIDTagEventArgs args) { rfid = args.Tag; mdh = new MysqlDataHelper(); string firstName = mdh.GetUserNameWithRfid(rfid); if (firstName != "") { lblVisitorName.Text = firstName + " :"; string status = mdh.GetCamping_StatusWithRfid(rfid); if (status == "in") { lb_visitorStatus.Text = "The Visitor is in the capming terrain"; } else if (status == "out") { lb_visitorStatus.Text = "The Visitor is out of the capming terrain"; } else if (status == "The camp does not exist") { lb_visitorStatus.Text = "No camping spot booked by the visitor"; } else if (status == "somthing wrong happened!!!") { lb_visitorStatus.Text = "somthing wrong happened!!!"; } else { lb_visitorStatus.Text = status; } } else { lb_visitorStatus.Text = ""; lblStatus.Text = "There is no user assigned to this rfid"; } Rfid.Close(); }
public void UserCheckingForRegistration(object sender, RFIDTagEventArgs args) { rfid = args.Tag; mdh = new MysqlDataHelper(); string firstName = mdh.GetUserNameWithRfid(rfid); if (firstName != "") { if (lblUser1Name.Text != "") { if (lblUser2Name.Text != "") { if (lblUser3Name.Text != "") { if (lblUser4Name.Text != "") { if (lblUser5Name.Text != "") { if (lblUser6Name.Text != "") { lblStatus.Text = "All users are checked !"; lblStatus.ForeColor = Color.Green; } else { lblUser6Name.Text = firstName; user6_id = mdh.GetUser_idWithRfid(rfid); } } else { lblUser5Name.Text = firstName; user5_id = mdh.GetUser_idWithRfid(rfid); } } else { lblUser4Name.Text = firstName; user4_id = mdh.GetUser_idWithRfid(rfid); } } else { lblUser3Name.Text = firstName; user3_id = mdh.GetUser_idWithRfid(rfid); } } else { lblUser2Name.Text = firstName; user2_id = mdh.GetUser_idWithRfid(rfid); } } else { lblUser1Name.Text = firstName; user1_id = mdh.GetUser_idWithRfid(rfid); } } else { lblStatus.Text = "There is no user found with that RFID"; } myRfid.Close(); }
private void btnCheckAvailability_Click_1(object sender, EventArgs e) { mdh = new MysqlDataHelper(); mdh.CampingSpotAvailability(); if (mdh.Camping_spots.Count == 0) { lbRegestration.Text = "camping spots are not available!"; lbRegestration.ForeColor = Color.Red; } if (!mdh.Camping_spots.Contains("1")) { pbSpot1.Hide(); } else { pbSpot1.Show(); } if (!mdh.Camping_spots.Contains("2")) { pbSpot2.Hide(); } else { pbSpot2.Show(); } if (!mdh.Camping_spots.Contains("3")) { pbSpot3.Hide(); } else { pbSpot3.Show(); } if (!mdh.Camping_spots.Contains("4")) { pbSpot4.Hide(); } else { pbSpot4.Show(); } if (!mdh.Camping_spots.Contains("5")) { pbSpot5.Hide(); } else { pbSpot5.Show(); } if (!mdh.Camping_spots.Contains("6")) { pbSpot6.Hide(); } else { pbSpot6.Show(); } if (!mdh.Camping_spots.Contains("7")) { pbSpot7.Hide(); } else { pbSpot7.Show(); } if (!mdh.Camping_spots.Contains("8")) { pbSpot8.Hide(); } else { pbSpot8.Show(); } if (!mdh.Camping_spots.Contains("9")) { pbSpot9.Hide(); } else { pbSpot9.Show(); } }