Пример #1
0
        /// <summary>
        /// Delete botton for escaperoom, shows a message box with a yes/no, if yes then calls erctr.Delete, last it calls "UpdateEscapeRoomList()"
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDeleteEscapeRoom_Click(object sender, EventArgs e)
        {
            EscapeRoomCtr erctr = new EscapeRoomCtr();
            DialogResult  result;

            result = MessageBox.Show("Du er ved at slette " + er.Name + ".  er du sikker", "slet Escaperoom", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                erctr.Delete(er.EscapeRoomID);
            }

            UpdateEscapeRoomList();
        }
Пример #2
0
        /// <summary>
        /// Runs ErCtr.Delete with the choosen escaperooms id
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int id = ER.EscapeRoomID;

            ERctr.Delete(id);
        }