private void btnWorkingPeriod_Click(object sender, EventArgs e) { Button SettingAll = (Button)sender; var menuid = Convert.ToInt32(SettingAll.Tag); var departmentid = UserLoginModel.UserLoginInfo.DepartmentID; var result = PermissionService.GetPermissionByDepartment(departmentid, menuid); if (result > 0) { frmShift frm = new frmShift(); frm.ShowDialog(); } else { frmMessager frm = new frmMessager("Messenger", "You can not accept. Please contact admin"); frmOpacity.ShowDialog(this, frm); } }