Exemple #1
0
 private void ChangeTagOnForm(object sender, TagEventArgs e)
 {
     label20.Text          = phidgetScanner.RFIDtagNr;
     lblcurrentStatus.Text = "The RFID tag is scanned";
     if (phidgetScanner.RFIDtagNr != null)
     {
         String rfidNr = phidgetScanner.RFIDtagNr;
         currentAccount = accountHelper.GetEventAccountFromRFID(rfidNr);
         label5.Text    = ""; label6.Text = ""; label7.Text = ""; label12.Text = ""; label13.Text = ""; label22.Text = "";
         if (currentAccount != null)
         {
             label5.Text  = currentAccount.FirstName + " " + currentAccount.LastName;
             label6.Text  = currentAccount.Email;
             label7.Text  = currentAccount.Phone;
             label12.Text = Convert.ToString(currentAccount.Balance);
             label13.Text = "";
             label22.Text = Convert.ToString(currentAccount.AccountId);
             if (currentAccount.RFID == "")
             {
                 label9.Text = "Returned";
             }
             else
             {
                 label9.Text = "Not Returned, " + currentAccount.RFID;
             }
         }
         else
         {
             lblcurrentStatus.Text = "The scanned RFID code does not exist in database.";
         }
     }
 }
        //DataGridViewRow newrow = new DataGridViewRow();
        private void ChangeTagOnForm(object sender, TagEventArgs e)
        {
            label20.Text = phidgetScanner.RFIDtagNr;
            if (phidgetScanner.RFIDtagNr != null)
            {
                rfid           = phidgetScanner.RFIDtagNr;
                currentAccount = accountHelper.GetEventAccountFromRFID(rfid);
                if (currentAccount != null)
                {
                    eID   = accountHelper.GetEventIdFromRFID(rfid);
                    email = accountHelper.GetAccountEmailFromRFID(rfid);
                    if (email != "")
                    {
                        scannedMember = groupHelper.GetGroupMembers(email);
                        if (scannedMember != null)
                        {
                            reservation = campDatHelper.GetCampRes(scannedMember.CampResNo);
                        }
                    }


                    if (reservation != null)
                    {
                        DataGridViewRow newrow = new DataGridViewRow();
                        //try
                        //{
                        newrow.CreateCells(dataGridView1);
                        newrow.Cells[0].Value = scannedMember.CampResNo;
                        newrow.Cells[1].Value = reservation.EndDate;
                        newrow.Cells[2].Value = reservation.StartDate;
                        newrow.Cells[3].Value = reservation.CampId;
                        newrow.Cells[4].Value = scannedMember.Co_Email;
                        newrow.Cells[5].Value = eID;
                        newrow.Cells[6].Value = scannedMember.CheckIn;
                        dataGridView1.Rows.Clear();
                        dataGridView1.Rows.Add(newrow);
                        //row++;
                        //}
                        //catch { MessageBox.Show("This reservation information is already displayed."); }
                    }
                    else
                    {
                        MessageBox.Show("This accountId does not have a camping reservation.");
                    }
                }
                else
                {
                    MessageBox.Show("The scanned RFID code does not exist in database.");
                }
            }
        }
Exemple #3
0
 private void ChangeTagOnForm(object sender, TagEventArgs e)
 {
     customerRFID          = phidgetScanner.RFIDtagNr;
     lblcurrentStatus.Text = "The RFID tag " + customerRFID.ToString() + " has scanned";
     currentAccount        = AccountdData.GetEventAccountFromRFID(customerRFID);
     if (currentAccount != null)
     {
         lblName.Text    = currentAccount.FirstName;
         lblBalance.Text = currentAccount.Balance.ToString("0.00");
     }
     else
     {
         lblcurrentStatus.Text = "The scanned RFID code does not exist in database.";
     }
 }
Exemple #4
0
        //kazkas turi but kas nuskanuoja RFID. Smth that scans RFID +
        private void ChangeTagOnForm(object sender, TagEventArgs e)
        {
            //Reset datagrid view
            dataGridViewReturn.Rows.Clear();
            dataGridViewReturn.Refresh();

            customerRFID = phidgetScanner.RFIDtagNr;
            person       = eaDataHelper.GetEventAccountFromRFID(customerRFID);
            if (person != null)
            {
                lbName.Text = person.FirstName;
                //Get loaned materials list
                loanedMaterials = invoiceDataHelper.GetPersonalMaterialInvoices(person.AccountId);
                //listBox1.Items.Clear();
                //listBox1.Items.Add("Name \t Quantity \t ReturnStatus");

                //Put items list into listbox +
                for (int i = 0; i < loanedMaterials.Count; i++)
                {
                    //Adds item name quantity and retunr status to the listbox
                    //listBox1.Items.Add(materials.Find(x => x.ID== loanedMaterials[i].Item_Id).Name+"\t"+loanedMaterials[i].Quantity+"\t"+loanedMaterials[i].ReturnStatus);


                    //Use datagrid view
                    DataGridViewRow newrow = new DataGridViewRow();
                    newrow.CreateCells(dataGridViewReturn);
                    newrow.Cells[0].Value = materials.Find(x => x.ID == loanedMaterials[i].Item_Id).Name;
                    newrow.Cells[1].Value = loanedMaterials[i].Quantity;
                    newrow.Cells[2].Value = loanedMaterials[i].ReturnStatus;

                    dataGridViewReturn.Rows.Add(newrow);
                }

                lblcurrentStatus.Text = "Customer's information is displayed";
            }
            else
            {
                lblcurrentStatus.Text = "The scanned RFID code does not exist in database.";
            }
        }