Example #1
0
        private void btnPay_Click(object sender, EventArgs e)
        {
            try
            {
                bool    ticketPaid = false;
                decimal amount     = Convert.ToDecimal(textBox2.Text);

                if (label14.Text != "")
                {
                    int          accountId      = Convert.ToInt32(label14.Text);
                    EventAccount currentAccount = accountHelper.GetAccount(accountId);
                    ticketPaid  = accountHelper.UpdateAccountBalanceEntrance(accountId, amount);
                    label8.Text = "€ " + Convert.ToString(accountHelper.GetAccountBalance(accountId));
                    if (currentAccount != null)
                    {
                        if (ticketPaid)
                        {
                            label10.Text = "Paid";
                        }
                    }
                }
            }
            catch
            { MessageBox.Show("Please enter appropriate amount."); }
        }
Example #2
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.";
         }
     }
 }
Example #3
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                accountId      = Convert.ToInt32(textBox1.Text);
                currentAccount = accountHelper.GetAccount(accountId);

                if (currentAccount != null)
                {
                    label5.Text  = Convert.ToString(currentAccount.FirstName) + " " + Convert.ToString(currentAccount.LastName);
                    label6.Text  = Convert.ToString(currentAccount.Email);
                    label22.Text = Convert.ToString(currentAccount.AccountId) + ", " + currentAccount.RFID;
                    label7.Text  = Convert.ToString(currentAccount.Phone);

                    if (currentAccount.RFID == "")
                    {
                        label9.Text = "Returned";
                    }
                    else
                    {
                        label9.Text = "Not Returned";
                    }
                    //must add the total spending of the client at the festival

                    label12.Text = Convert.ToString(currentAccount.Balance);
                }
            }
            catch { MessageBox.Show("Please enter an id in the textbox."); }
        }
Example #4
0
        //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.");
                }
            }
        }
Example #5
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.";
     }
 }
Example #6
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.";
            }
        }
Example #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            accountId      = Convert.ToInt32(textBox1.Text);
            currentAccount = accountHelper.GetAccount(accountId);

            if (currentAccount != null)
            {
                label5.Text  = currentAccount.FirstName + " " + currentAccount.LastName;
                label6.Text  = currentAccount.Email;
                label7.Text  = currentAccount.Phone;
                label14.Text = Convert.ToString(accountId);
                label16.Text = currentAccount.RFID;

                if (currentAccount.PaymentStatus)
                {
                    label10.Text = "Paid";
                }
                else
                {
                    label10.Text = "Not Paid";
                }
                label8.Text = "€ " + Convert.ToString(currentAccount.Balance);
            }
        }
Example #8
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                accountId=Convert.ToInt32(textBox1.Text);
                currentAccount=accountHelper.GetAccount(accountId);

                if (currentAccount != null)
                {
                    label5.Text = Convert.ToString(currentAccount.FirstName) + " " + Convert.ToString(currentAccount.LastName);
                    label6.Text = Convert.ToString(currentAccount.Email);
                    label22.Text = Convert.ToString(currentAccount.AccountId)+", "+currentAccount.RFID;
                    label7.Text = Convert.ToString(currentAccount.Phone);

                    if (currentAccount.RFID == "")
                    { label9.Text = "Returned"; }
                    else { label9.Text = "Not Returned"; }
                    //must add the total spending of the client at the festival

                    label12.Text = Convert.ToString(currentAccount.Balance);
                }
            }
            catch { MessageBox.Show("Please enter an id in the textbox."); }
        }
Example #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            accountId = Convert.ToInt32(textBox1.Text);
            currentAccount = accountHelper.GetAccount(accountId);

            if (currentAccount!= null)
            {

                label5.Text=currentAccount.FirstName+" "+currentAccount.LastName;
                label6.Text=currentAccount.Email;
                label7.Text = currentAccount.Phone;
                label14.Text = Convert.ToString(accountId);
                label16.Text = currentAccount.RFID;

                if (currentAccount.PaymentStatus) { label10.Text = "Paid"; }
                else { label10.Text = "Not Paid"; }
                label8.Text = "€ "+Convert.ToString(currentAccount.Balance);
            }
        }
Example #10
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.";
     }
 }
Example #11
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.";
            }
        }
Example #12
0
        //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."); }
            }
        }
Example #13
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.";
         }
     }
 }