//Choose Book Reset// private void Reset() { _book = null; SelectedName.Text = " "; BtnDelete.Show(); BtnUpdate.Show(); FillDataAdd(); }
//Coohe Manager Reset// private void Reset() { _manager = null; LblSelectedName.Text = " "; BtnDelete.Show(); BtnUpdate.Show(); FillDataManager(); }
//DataGridView Cell Click// private void DgvAddBooks_CellClick(object sender, DataGridViewCellEventArgs e) { try { id = (int)DgvAddBooks.Rows[e.RowIndex].Cells[0].Value; _book = _bookDal.GetById(id); SelectedLabel.Show(); BtnDelete.Show(); BtnUpdate.Show(); SelectedName.Text = _book.Name; } catch { } }
private void DgvViewAllLibrarians_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { _selectedLibrarian = _librarianService.FindId(Convert.ToInt32(DgvViewAllLibrarians.Rows[e.RowIndex].Cells[0].Value)); _selectedRowIndex = e.RowIndex; TxtLibrarianName.Text = _selectedLibrarian.Username; TxtLibrarianEmail.Text = _selectedLibrarian.Email; TxtLibrarianPassword.Text = _selectedLibrarian.Password; TxtLibrarianPhone.Text = _selectedLibrarian.Phone; BtnAdd.Hide(); BtnDelete.Show(); BtnUpdate.Show(); }
//ManagerForm-DataGridView-Cell Click Choose Id// private void DgvManagerShow_CellClick(object sender, DataGridViewCellEventArgs e) { try { id = (int)DgvManagerShow.Rows[e.RowIndex].Cells[0].Value; _manager = _managerDal.GetById(id); LblSelected.Show(); LblSelectedName.Show(); BtnDelete.Show(); BtnUpdate.Show(); LblSelectedName.Text = _manager.Name + " " + _manager.Surname; } catch { } }
private void DgvBooks_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { _selectedBook = _bookService.Find(Convert.ToInt32(DgvBooks.Rows[e.RowIndex].Cells[0].Value)); _selectedRowIndex = e.RowIndex; TxtBookName.Text = _selectedBook.Name; TxtBookAuthor.Text = _selectedBook.Author; TxtBookPrice.Text = Convert.ToString(_selectedBook.Price); TxtBookQuantity.Text = _selectedBook.Quantity.ToString(); DtpPurchaseDate.Value = _selectedBook.PurchaseDate.Date; BtnAdd.Hide(); BtnDelete.Show(); BtnUpdate.Show(); }
private void DgvViewAllMembers_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { _selectedMember = _memberService.Find(Convert.ToInt32(DgvViewAllMembers.Rows[e.RowIndex].Cells[0].Value)); _selectedRowIndex = e.RowIndex; TxtMemberFullname.Text = _selectedMember.Fullname; TxtMemberAddress.Text = _selectedMember.Address; TxtMemberEmail.Text = _selectedMember.Email; TxtMemberPassword.Text = _selectedMember.Password; TxtMemberPhone.Text = _selectedMember.Phone; DtpCreatedAt.Value = _selectedMember.CreatedAt; BtnAdd.Hide(); BtnDelete.Show(); BtnUpdate.Show(); }
private void DataGridView1_Click(object sender, EventArgs e) { selectedId = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value.ToString()); TxtName.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); TxtDesignation.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); TxtContact.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); TxtAddress.Text = dataGridView1.CurrentRow.Cells[4].Value.ToString(); if (teacher == "Head Teacher") { BtnUpdate.Show(); BtnDelete.Show(); } else { BtnUpdate.Hide(); BtnDelete.Hide(); } }
public void Nav(Form form, Panel panel) { // changing view for content panel form.TopLevel = false; form.Size = panel.Size; // for responsive size panel.Controls.Clear(); panel.Controls.Add(form); form.Show(); // getting name of form that is being viewed, and assigning header title and button text from from that value nameOfFormOpen = form.Name; string currTitle = ""; string newTitle = ""; // removing value "GUI" from name to be more user friendly if (nameOfFormOpen.Contains("GUI")) { currTitle = nameOfFormOpen.Replace("GUI", ""); newTitle = InsertSpaceBeforeUpperCase(currTitle); } lblNameOfFormOpen.Text = newTitle; ChangeButtons(newTitle.ToLower()); if (nameOfFormOpen.Equals("DashboardGUI") || nameOfFormOpen.Equals("VenuesGUI")) { //if (nameOfFormOpen.Equals("DashboardGUI")) { HideButtons(); } else if (nameOfFormOpen.Equals("ReservationsGUI")) { BtnCreateNew.Hide(); BtnEdit.Hide(); BtnDelete.Show(); } else { ShowButtons(); } }
public void ShowButtons() { BtnCreateNew.Show(); BtnEdit.Show(); BtnDelete.Show(); }