public static bool VolunteerLeaderInOrg(CMSDataContext db, int? orgid)
{
if (orgid == null)
return false;
var o = db.LoadOrganizationById(orgid);
if (o == null || o.RegistrationTypeId != RegistrationTypeCode.ChooseVolunteerTimes)
return false;
if (HttpContext.Current.User.IsInRole("Admin") ||
HttpContext.Current.User.IsInRole("ManageVolunteers"))
return true;
var leaderorgs = db.GetLeaderOrgIds(Util.UserPeopleId);
if (leaderorgs == null)
return false;
return leaderorgs.Contains(orgid.Value);
}