Exemplo n.º 1
0
 private void overdueItemsGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 9 || e.ColumnIndex == 0)
     {
         int indexRow = e.RowIndex;
         if (indexRow >= 0)
         {
             DataGridViewRow row      = this.overdueItemsGridView.Rows[e.RowIndex];
             var             borrower = new currentBorrower();
             borrower.EmailAddress = row.Cells["BorrowerEmail"].Value.ToString();
             EmailHandler emailBorrower = new EmailHandler(borrower.EmailAddress);
             emailBorrower.Show();
         }
     }
 }
Exemplo n.º 2
0
 private void studentGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) //grabs email of row clicked and fills emailhandler form email box
 {
     if (e.ColumnIndex == 9 || e.ColumnIndex == 0)
     {
         int indexRow = e.RowIndex;
         if (indexRow >= 0)
         {
             DataGridViewRow row     = this.studentGridView.Rows[e.RowIndex];
             var             student = new currentBorrower();
             student.EmailAddress = row.Cells["EmailAddress"].Value.ToString();
             EmailHandler emailhandler = new EmailHandler(student.EmailAddress);
             emailhandler.Show();
             this.Close();
         }
     }
 }
Exemplo n.º 3
0
 private void btnConfirmItems_Click(object sender, EventArgs e)
 {
     checkIfUserHasLoan();
     foreach (DataGridViewRow row in pickedItemsGridView.Rows)
     {   //string maxprd = row.Cells["MaxLoanPeriod"].Value.ToString();
         int maxprd       = 0;
         int resourceid   = 0;
         int quantity     = 0;
         int serialnumber = 0;
         Int32.TryParse(row.Cells["MaxLoanPeriod"].Value.ToString(), out maxprd);
         Int32.TryParse(row.Cells["ResourceID"].Value.ToString(), out resourceid);
         Int32.TryParse(row.Cells["Quantity"].Value.ToString(), out quantity);
         Int32.TryParse(row.Cells["SerialNumber"].Value.ToString(), out serialnumber);
         //MessageBox.Show(maxprd);
         var borrower = new currentBorrower();
         borrower.FirstName    = txtCurrentName.Text;
         borrower.Surname      = txtCurrentSurname.Text;
         borrower.ShuId        = txtCurrentId.Text;
         borrower.EmailAddress = txtCurrentEmail.Text;
         borrower.ScannableNum = txtScanID.Text;
         borrower.UserType     = txtUserType.Text;
         var item = new currentItem();
         item.ResourceType  = row.Cells["ResourceType"].Value.ToString();
         item.ResourceName  = row.Cells["ResourceName"].Value.ToString();
         item.MaxLoanPeriod = maxprd;
         item.Department    = row.Cells["Department"].Value.ToString();
         item.Quantity      = quantity;
         item.SerialNumber  = serialnumber;
         //item.SerialNumber = (long)row.Cells["SerialNumber"].Value;
         //item.DateAdded = row.Cells["DateAdded"].Value.ToString();
         //item.SupplierSource = row.Cells["SupplierSource"].Value.ToString();
         //item.PurchasePrice = (decimal)row.Cells["PurchasePrice"].Value;
         //item.Notes = row.Cells["Notes"].Value.ToString();
         item.ItemID = resourceid;
         LoanDurations loanInfo = new LoanDurations(item.ResourceType, item.ResourceName, item.MaxLoanPeriod,
                                                    item.Quantity, item.Department, item.ItemID, borrower.FirstName, borrower.Surname,
                                                    borrower.ShuId, borrower.EmailAddress, borrower.ScannableNum, borrower.UserType, item.SerialNumber);
         loanInfo.Show();
     }
     this.Close();
 }
Exemplo n.º 4
0
 private void studentGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) //send row clicked information to another form
 {
     if (e.ColumnIndex == 9 || e.ColumnIndex == 0)
     {
         int indexRow = e.RowIndex;
         if (indexRow >= 0)
         {
             DataGridViewRow row      = this.studentGridView.Rows[e.RowIndex];
             var             borrower = new currentBorrower();
             borrower.ShuId        = row.Cells["ShuId"].Value.ToString();
             borrower.FirstName    = row.Cells["FirstName"].Value.ToString();
             borrower.Surname      = row.Cells["Surname"].Value.ToString();
             borrower.EmailAddress = row.Cells["EmailAddress"].Value.ToString();
             borrower.ScannableNum = row.Cells["ScannableNum"].Value.ToString();
             borrower.UserType     = row.Cells["UserType"].Value.ToString();
             LoanUserItem loanItem = new LoanUserItem(borrower.ShuId, borrower.FirstName, borrower.Surname,
                                                      borrower.EmailAddress, borrower.ScannableNum, borrower.UserType);
             loanItem.Show();
         }
     }
 }
Exemplo n.º 5
0
 private void studentGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) //when certain column is clicked, open new form with selected row information
 {
     if (e.ColumnIndex == 9 || e.ColumnIndex == 0)
     {
         int indexRow = e.RowIndex;
         if (indexRow >= 0)
         {
             DataGridViewRow row      = this.studentGridView.Rows[e.RowIndex];
             var             borrower = new currentBorrower();
             borrower.ShuId        = row.Cells["ShuId"].Value.ToString();
             borrower.FirstName    = row.Cells["FirstName"].Value.ToString();
             borrower.Surname      = row.Cells["Surname"].Value.ToString();
             borrower.CourseDept   = row.Cells["CourseDept"].Value.ToString();
             borrower.EmailAddress = row.Cells["EmailAddress"].Value.ToString();
             borrower.DateCreated  = row.Cells["DateAdded"].Value.ToString();
             borrower.StartDate    = row.Cells["StartDate"].Value.ToString();
             borrower.UserType     = row.Cells["UserType"].Value.ToString();
             borrower.ScannableNum = row.Cells["ScannableNum"].Value.ToString();
             viewStudentInfo viewInfo = new viewStudentInfo(borrower.ShuId, borrower.FirstName, borrower.Surname,
                                                            borrower.CourseDept, borrower.EmailAddress, borrower.DateCreated, borrower.StartDate, borrower.UserType, borrower.ScannableNum);
             viewInfo.Show();
         }
     }
 }