コード例 #1
0
        private void btnEditFood_Click(object sender, EventArgs e)
        {
            if (FoodTable.CurrentRow == null)
            {
                return;
            }
            long FoodID = long.Parse(FoodTable.CurrentRow.Cells[FoodId.Index].Value.ToString());

            if (editFood == null || editFood.IsDisposed)
            {
                editFood       = new EditFood(FoodDB.GetFood(FoodID));
                editFood.Owner = this;
            }
            editFood.Show();
        }
コード例 #2
0
        private void btnPrintFood_Click(object sender, EventArgs e)
        {
            if (FoodTable.SelectedRows.Count == 0)
            {
                return;
            }

            PrintDocument printDocument = new PrintDocument();

            printDocument.PrintPage += PrintDocument_PrintPage;
            foodToPrint              = FoodDB.GetFood(long.Parse(FoodTable.CurrentRow.Cells[FoodId.Index].Value.ToString()));

            PrintDialog printDialog = new PrintDialog();

            printDialog.ShowDialog(this);
            printDocument.PrinterSettings = printDialog.PrinterSettings;

            printDocument.Print();
        }