private void btnEnd_Click(object sender, EventArgs e) { Button EndShift = (Button)sender; ShiftHistoryModel shiftmodel = (ShiftHistoryModel)(EndShift.Tag); if (shiftmodel != null) { frmEndShift frm = new frmEndShift(shiftmodel); frm.ShowDialog(); if (frm.DialogResult == System.Windows.Forms.DialogResult.OK) { addOnDutyList("On Duty", 1); frm.Close(); } } else { frmMessager frm = new frmMessager("Messenger", "Please select row befor end shift."); frmOpacity.ShowDialog(this, frm); } }