示例#1
0
 private void BackButton_Click(object sender = null, EventArgs e = null)
 {
     if (book == null)
     {
         Utils.SwitchBetweenWindows(this, BookForm.Instance());
     }
     else
     {
         Utils.SwitchBetweenWindows(this, BookDetails.Instance(book));
     }
 }
示例#2
0
        /// <summary>
        /// in case double click on cell the book detail form will open.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BookGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            Book         book         = (Book)this.BookGrid.CurrentRow.DataBoundItem;
            DialogResult dialogResult = MessageBox.Show($"האם תרצה לעבור לפרטי הספר {book.BookName} ", "השאלת ספר", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                var form = BookDetails.Instance((Book)(book));
                Utils.SwitchBetweenWindows(this, form);
            }
        }