コード例 #1
0
 private void closeUpdateToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.Width  = 1151;
     this.Height = 555;
     BookIssuedetailsSearchPanel.Show();
     BookReservationDetailsView.Show();
     PagingPanel.Show(); BookissueUpdategroupBox.Hide();
     closeUpdateToolStripMenuItem.Enabled = false;
     _selectedId = "";
 }
コード例 #2
0
        private void ReservationUpdateButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (_selectedId != "")
                {
                    BookReservationDetailsView.Hide();
                    BookIssuedetailsSearchPanel.Hide();
                    BookissueUpdategroupBox.Show();
                    PagingPanel.Hide();
                    closeUpdateToolStripMenuItem.Enabled = true;

                    this.Width  = 1151;
                    this.Height = 415;
                    using (
                        var connection =
                            new SqlConnection(ConnectionString)
                        )
                    {
                        var command =
                            new SqlCommand(
                                "select Isbn,Title,br.DayOfBorrowed,br.DayOfReturn  from Borrow br join Book b on br.BookId=b.BookId join Student s on br.StudentId=s.Id where s.StudentId=@StudentId",
                                connection);
                        command.Parameters.AddWithValue("@StudentId", _selectedId);

                        connection.Open();

                        SqlDataReader reader = command.ExecuteReader();
                        reader.Read();
                        IsbnUpdateTextBox.Text = reader[0].ToString();

                        IssueDatePicker.Text  = reader[2].ToString();
                        ReturnDatePicker.Text = reader[3].ToString();
                    }
                }
                else
                {
                    var objDialogWindow = new DialogWindow("Please select an ID to Update", "Warning Dialog", DialogWindow.DialogBoxIconType.Exclamation);
                    objDialogWindow.ShowDialog();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
コード例 #3
0
        private void BookReservationDetailsForm_Load(object sender, EventArgs e)
        {
            lFormDefineLabel.Hide();
            BookissueUpdategroupBox.Hide();
            this.Height = 620;
            closeUpdateToolStripMenuItem.Enabled = this.Height != 555;
            var t = new ToolTip();

            t.SetToolTip(ReservationRefreshButton, "Reload");
            t.SetToolTip(ReservationSearchButton, " Search");
            t.SetToolTip(ReservationFilterComboBox, "Filter Data");
            t.SetToolTip(ReservationSearchTextBox, "Enter a valid ID.You must enter full ID.");
            t.SetToolTip(ReservationUpdateButton, "Update a record by Selecting an ID");
            t.SetToolTip(ReservationDeleteId, "Delete a record by Selecting an ID");
            LoadGridData();

            CountLabel.Show(); BackColor         = Color.CornflowerBlue;
            closeUpdateToolStripMenuItem.Enabled = false;
        }