private void NotifyAboutAssignedVolunteer(Person person, Volunteer volunteer) { //"A volunteer for officer duty, {0}, was just assigned to you. " + //"Please check this at https://pirateweb.net/Pages/v4/ListVolunteers.aspx and delegate or " + //"process as soon as possible. The person volunteers for the following roles:\r\n\r\n "+ //"{1}" + //"\r\nAs a general rule, leads should be assigned by the lead immediately above " + //"them in the org, and vices and admins should be assigned by the lead in the same area. " + //"Delegate the assessment and assignment to the correct person.\r\n"; string mailbody = this.GetLocalResourceObject("AssignmentMailMessage").ToString(); string mailbodyInclusion = this.GetLocalResourceObject("AssignmentMailInclusion").ToString(); string mailSubject = this.GetLocalResourceObject("AssignmentMailSubject").ToString(); VolunteerRoles roles = volunteer.Roles; string rolesString = ""; foreach (VolunteerRole role in roles) { rolesString += string.Format("\r\n" + mailbodyInclusion, role.RoleType.ToString(), role.Geography.Name); } mailbody = string.Format(mailbody, volunteer.Name, rolesString); person.SendOfficerNotice(mailSubject, mailbody, Organization.PPSEid); }
public ActionResult DeleteConfirmed(Int32 id) { VolunteerRoles volunteerroles = db.VolunteerRoles.Find(id); db.VolunteerRoles.Remove(volunteerroles); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /VolunteerRoles/Delete/5 public ActionResult Delete(Int32 id) { VolunteerRoles volunteerroles = db.VolunteerRoles.Find(id); if (volunteerroles == null) { return(HttpNotFound()); } return(View(volunteerroles)); }
public ActionResult Edit(VolunteerRoles volunteerroles) { if (ModelState.IsValid) { db.Entry(volunteerroles).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(volunteerroles)); }
public ActionResult Create(VolunteerRoles volunteerroles) { if (ModelState.IsValid) { db.VolunteerRoles.Add(volunteerroles); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(volunteerroles)); }
protected void Page_Load(object sender, EventArgs e) { string volunteerIdString = Request.QueryString["VolunteerId"]; if (String.IsNullOrEmpty(volunteerIdString)) { volunteerIdString = "1"; // for debug } int volunteerId = Int32.Parse(volunteerIdString); Volunteer volunteer = Volunteer.FromIdentity(volunteerId); int currentUserId = Convert.ToInt32(HttpContext.Current.User.Identity.Name); if (volunteer.OwnerPersonId != currentUserId) { throw new UnauthorizedAccessException(); } Page.Title = "Managing " + volunteer.Name; this.LabelVolunteerPhone.Text = volunteer.Phone; this.LabelVolunteerName.Text = volunteer.Name; if (volunteer.Person.GetMemberships().Count > 1) { this.LabelVolunteerName.Text += " (#" + volunteer.PersonId + ")"; this.LiteralMemberFound.Text = this.LiteralFound.Text; } else { this.LiteralMemberFound.Text = this.LiteralNotFound.Text; } this.LabelVolunteerGeography.Text = volunteer.Geography.Name + ", " + volunteer.Geography.Parent.Name; VolunteerRoles roles = volunteer.Roles; foreach (VolunteerRole role in roles) { string roleDescription = string.Empty; switch (role.RoleType) { case RoleType.LocalLead: roleDescription = "Primary lead of "; break; case RoleType.LocalDeputy: roleDescription = "Deputy of "; break; case RoleType.LocalAdmin: roleDescription = "Administrator of "; break; default: roleDescription = "UNKNOWN ROLE [" + role.RoleType.ToString() + "] of "; break; } this.ChecksVolunteerRoles.Items.Add( new ListItem(roleDescription + role.Geography.Name + " (check if you assign the role)", role.Identity.ToString())); } }