void CustomDialog_OkClick(object sender, IdAndNameEventArgs e) { //mark complete var user = Page.User as CustomPrincipal; //&& (user.IsInRole(DbHelper.StaticValues.Roles.Manager) // || user.IsInRole(DbHelper.StaticValues.Roles.Teacher)) if (user != null) { using (var helper = new DbHelper.Classes()) { bool saved = helper.MarkComplete(SubjectClassId, user.Id); if (saved) { lnkMarkCompletion.Visible = false; lnkEnrollStudents.Visible = false; lnkEnrollTeachers.Visible = false; CustomDialog.CloseDialog(); } } } }